Skip to content

collect tweets of a selected timeframe and calculate the average polarity of the tweets

Notifications You must be signed in to change notification settings

derWahnsinn/tweet2polarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

tweet2polarity

collect tweets of a selected timeframe and calculate the average polarity of the tweets

Getting Started

usage: tweet2polarity.py [-h] [-t T [T ...]] [-s S]

optional arguments:
  -h, --help    show this help message and exit
  -t T [T ...]  filter hashtags (example: -t dog cat fish)
  -s S          seconds to calculate the average of the polarity

Prerequisites

install dependencies:

pip install tweepy textblob

Installing

git clone https://github.com/derWahnsinn/tweet2polarity.git
cd tweet2polarity/

edit the api.key file with you twitter credentials

example api.key file:

consumer_key = klajsdlfija890sd8u9fa0djlo
consumer_secret = djfhnkajshdudifhklwern989jomiy9x8c
access_token = 1929828347-1930sfxj88d0ajdijr00239as
access_token_secret = c8xilxmlijaosd9u0x98jos

now run tweet2polarity with your desired #hashtags and timeframe like:

python tweet2polarity.py -t dog cat fish -s 1

will give something like:

alt text

About

collect tweets of a selected timeframe and calculate the average polarity of the tweets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages