How To Extract Tweets Using RStudio In 10 Simple Steps
How To Extract Tweets Using RStudio In 10 Simple Steps

How To Extract Tweets Using RStudio In 10 Simple Steps

2054

Step 1: Login with your Twitter login details
Step 2: Go to https://apps.twitter.com and click on create New App
Step 3: Compare the mandatory fields with Your 'Name'.'Description' and in 'website'(https://www.excelr.com/) and 'call-back URL'as blank
Step 4: Check the option 'Yes,I agree' under Developer Agreement and click on 'your Twitter application'
Step 5: Click on the 'Key and Access tokens'section to find your consumer key and 'Consumer secret'key
Step 6: Click on the 'Create My access token'button and you can find your Access TOken key and Access Token Secret Keys
Step 7: Install all pakages shown in below image and run from lines 1 to 8 row
Step 8: Replace consumer key with your consumer key and consumer secret and run the code from lines 10 to 14 & also run lines 16 & 17
Step 09: In console, it will ask you to select option Yes or No, Press option 1 to proceed with authentication for Rdata.
Step 10: In console, it will ask you to select option Yes or No, Press option 1 to proceed with authentication for Rdata.
Run line 29 of the code by providing the Twitter account name of your area of interest in the single

quotes instead of ‘narendramodi’.

Line No 29 Tweetswill extract Narendramodi’s 1000 tweet. You can replace with any other person twitter profile name by changing in single quotes and “n” is value to extract no of tweets.
 

Step 1Login with your Twitter login details.

Step 2: Go to https://apps.twitter.com and click on Create New App

Step 3: complete the mandatory fields with your ‘Name’, ‘Description’ and in ‘Website’ (https://www.excelr.com) and ‘call-back URL’ as blank 

Step 4: Check the option ‘Yes, I agree’ under Developer Agreement and Click on ‘your Twitter application’.

Step 5:Click on the Key and Access tokens’ section to find your Consumer key and Consumer Secret’ key

Step 6:Click on the Create My access token’ button and you can find your Access Token key and Access Token Secret keys

Step 7:Install all packages shown in below Image and run from lines 1 to 8 row

Step 8:Replace consumer Key with your Consumer key and consumer Secret and run the code from lines 10 to 14 & also run lines 16 & 17.

<

Step 09: In console, it will ask you to select option Yes or No, Press option 1 to proceed with authentication for Rdata.

Step 10: In console, it will ask you to select option Yes or No, Press option 1 to proceed with authentication for Rdata.

Run line 29 of the code by providing the Twitter account name of your area of interest in the single

quotes instead of ‘narendramodi’.

Line No 29 Tweetswill extract Narendramodi’s 1000 tweet. You can replace with any other person twitter profile name by changing in single quotes and “n” is value to extract no of tweets.

Now Run the code in lines  31 and 32 to create a CSV file of Modi’s tweets and to know the location of CVS file type “getwd()” which will show path of the CSV file as show in the below image.

Don’t forget to share this post,

Comment and get your doubts cleard!

 

Post Comments

Call Us