0.2 Twitter credentials
The book uses Twitter data for a few exercises. I use the excellent rtweet
package for accessing Twitter API. You will need an approved developer Twitter account and a functional Twitter app. Mike Kearly, the author of rtweet
has a detailed post about how to set up an app and get the secret keys. you can follow it here: https://rtweet.info/articles/auth.html. However, the post is a bit old and the screenshots don’t look like the current Twitter menu. Although all his instructions are still valid, in this section I am showing you current screenshots.2
Step 1. Visit https://developer.twitter.com/ and request an account.
![Apply for Developer Account](img/twitter-cred/01-apply-developer.png)
Figure 0.1: Apply for Developer Account
Step 2. Once you get the approval, log into the new account and click on your user name on top right to display menu. Click on “Apps”.
![Display the Menu for Apps](img/twitter-cred/02-apps-menu.png)
Figure 0.2: Display the Menu for Apps
Step 3. Click on “Create an app” button.
![Create an App](img/twitter-cred/03-create-app.png)
Figure 0.3: Create an App
Step 4. Fill in your app details. All the required fields need to be filled up.
![Fill in App Details](img/twitter-cred/04-app-details-fill.png)
Figure 0.4: Fill in App Details
Step 5. You will need to provide the following callback URL: http://127.0.0.1:1410.
![Provide Callback URL](img/twitter-cred/05-callback-url.png)
Figure 0.5: Provide Callback URL
Step 6. Describe how you plan to use this app. “Data collection for academic research and teaching” is a valid use.
![Planned App Use](img/twitter-cred/06-app-use.png)
Figure 0.6: Planned App Use
Step 7. After setting up the app, verify the app details.
![Check App Details](img/twitter-cred/07-app-details.png)
Figure 0.7: Check App Details
Step 8. Note down the API keys and access tokens. You will need these for accessing the Twitter API.
![Keys and Tokens](img/twitter-cred/08-keys-tokens.png)
Figure 0.8: Keys and Tokens
As of May 15, 2019↩