Skip to content

Disclaimer: This project has nothing to with politics and has been completed just out of academic interest.

Notifications You must be signed in to change notification settings

kaymomin/Twitter-Profile-Analysis-of-ImranKhan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Analyzing the Twitter Profile of Imran Khan - Prime Minister of Pakistan.

Before diving into details, here are the key parts of the projects:

  • Create an account on Twitter
  • Use Tweepy to scrap the Tweets
  • Create a Panda DataFrame
  • Sentiment analysis
  • Word frequency analysis

Step 1: Create an account on Twitter

In order to access Twitter Streaming API, we need to get 4 pieces of information from Twitter: API key, API secret, Access token and Access token secret. But for that we need to create a twitter account. So create an account if you don't already have one.

Step 2: Use Tweepy to scrap the Tweets

The file explorer is accessible using the button in left corner of the navigation bar. You can create a new file by clicking the New file button in the file explorer. You can also create folders by clicking the New folder button.

Step 3: Getting Twitter API keys and connecting to Twitter Streaming API

  • Go to https://apps.twitter.com/ and log in with your twitter credentials.
  • Click "Create New App"
  • Fill out the form, agree to the terms, and click "Create your Twitter application"
  • In the next page, click on "API keys" tab, and copy your "API key" and "API secret".
  • Scroll down and click "Create my access token", and copy your "Access token" and "Access token secret".

Tweepy is easy-to-use Python library for accessing the Twitter API. (pip install tweepy)

Step 4: Create a Panda DataFrame

Dta

Step 5: Sentiment analysis

ne

Step 6: Word frequency analysis

ik

About

Disclaimer: This project has nothing to with politics and has been completed just out of academic interest.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages