Oxford Spring School, 2022
Christopher Barrie
Counting tweets
Applied examples
Group work
Getting tweets
Applied examples
Group work
Getting friends/followers
Applied examples
Group work
Getting data outside the API
Applied examples
Group work
Replication task
1.5 hrs prep.
1.5 hrs pres.
Research question
Data you targeted
Empirical strategy (e.g., experimental, observational, inferential)
Findings
Why?
Especially, since intro. of Academic Research Product Track…
Go here
Or a live example…
This is what the Developer Portal looks like
Don’t forget to Restart R
We’re good to go 🥳
We’re good to go 🥳
But before we do that…
Extracts visible content from screen
Often trial and error as not optimized for serving data ( legibility not readability)
Requests content from a “blank” version of page
Delivers data in more readily usable format (JSON, csv etc.)
Essentially, a long URL string…
TODO Insert example API request here
my_query <- "#BLM lang:EN"
endpoint_url <- "https://api.twitter.com/2/tweets/search/all"
params <- list(
"query" = my_query,
"start_time" = "2021-01-01T00:00:00Z",
"end_time" = "2021-07-31T23:59:59Z",
"max_results" = 20
)
params$query
[1] "#BLM lang:EN"
$start_time
[1] "2021-01-01T00:00:00Z"
$end_time
[1] "2021-07-31T23:59:59Z"
$max_results
[1] 20
academictwitteR
academictwitteRAPIs
research design