Twitter Data API access in RSTUDIO

Get access to the Twitter API:

Create an APP, as documented here:

Annotation 2019-11-05 073528

Click on “Details”, then “Keys and tokens”

Annotation 2019-11-05 073800

(The credentials listed above will not work)

Use the generated credentials as below:

myapp = oauth_app("twitter",
sig = sign_oauth1.0(myapp,
token = "1129684236733227008-EsgKImtzWxtvawBHPDBG01LKp9O413",
token_secret = "4YKBlKXTgerRiocYWrTW8XTaVWd8O91TzPhE1UJ2AggCu")
homeTL = GET("", sig)
json1 = content(homeTL)
json2 = jsonlite::fromJSON(toJSON(json1))
view raw con_twit.R hosted with ❤ by GitHub

So where did the URL in GET come from?

The API Reference contains these instructions:

Annotation 2019-11-05 080500.png

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.