R code for Twitter Scrape and Estimation
Keywork plot
Tweet count plot
Other data source
Toy data
snapshots
movies
Crystalized sociograms
Parameter estimates
Parameter estimates
Code must be adapted for scraped data
Scraping Twitter in R
Getting access codes
Copy all these and save them to paste into R code
Setting up tokens: fill in the “” in Scraping Twitter:�Please download and save to a file on your machine�
Conceptualization: Network analysis is about what flows�
6
Conceptualization: Think about the network model of influence
7
Yi’t-1
Wii’t-1🡪t
Yit
t
t-1
B
C
D
Process for Choosing a topic
8
reflection
Conceptualization: Think about the process of selection
9
t
t-1
Wii’t-1🡪t
C
B
C
D
Choose your keywords
10
reflection
Timing: Think about the network model of influence
11
Yi’t-1
Wii’t-1🡪t
Yit
t
t-1
B
C
D
Timing The Formal Model of Influence -- the Network Effect
Interactions between i and i’ between t-1 and t.
12
Scrape Twitter Timeline for Diffusion:�See Influence Model
Pre interaction
sentiments
T1
T0
Interaction interval
Mention, retweet, reply
T2
Post interaction
sentiments
time_interval1
time_interval2
time_interval3
T3
Yit
Wii’t-1🡪t
Yi’t-1
Time interval code
Check size of scrape
Keyword plot over time
Reduce size as needed: scrape can take a long time
Execute full tweet, produces edgelist and node data