Skip to content

josiahls/TwitterAnalyser

Repository files navigation

Twitter Crawler

  • Author: Josiah Laivins
  • Date: 2/17/2018
  • Course: ITCS 6112

Program uses the twitter API for accessing a large number of tweets. They are mostly limited to about 2 weeks of tweets, however should be plently for this small analyzer.

Installation

Note that the following needs to be applied in the twitter.py. Got to: https://apps.twitter.com/ to make an account to apply these links:

  • ACCESS_TOKEN = ''
  • ACCESS_SECRET = ''
  • CONSUMER_KEY = ''
  • CONSUMER_SECRET = ''

You should be set! Just execute twitter.py either through an ide or via python3 twitter

The prompts should walk you through the rest. 5 files will be generated.

output.txt contains the raw file output. The next 4 will contian any interesting data as described by their file titles.

Example Output:

Input

'trump'
'2018-01-01'
'2018-02-17'
80
10

Outputs for each file:

max retweets of tweets
Tweet: penleyvic [16/Feb/2018:23:59:59 ] Total reweets: 12242
Tweet: MAGA4TRUMP2020 [16/Feb/2018:23:59:59 ] Total reweets: 10763
Tweet: mbrand2815 [16/Feb/2018:23:59:58 ] Total reweets: 7778
Tweet: johanwirfalt [16/Feb/2018:23:59:59 ] Total reweets: 7486
Tweet: paolo_sf [16/Feb/2018:23:59:57 ] Total reweets: 6398
Tweet: beinpulse [16/Feb/2018:23:59:59 ] Total reweets: 5685
Tweet: Rtfighter_MAGA [16/Feb/2018:23:59:59 ] Total reweets: 4048
Tweet: SumatraSue [16/Feb/2018:23:59:59 ] Total reweets: 3714
Tweet: AnsareSummers [16/Feb/2018:23:59:57 ] Total reweets: 3651
Tweet: theLegacyPrep [16/Feb/2018:23:59:57 ] Total reweets: 3525

user max followers
User: rap0322 Total followers: 35838
User: stumblinginn Total followers: 35838
User: iateyourfrog Total followers: 29399
User: c2bryant Total followers: 27838
User: duckyjd Total followers: 27838
User: lauralazsewell Total followers: 27838
User: lynnepithecus Total followers: 27838
User: IDGomez_Austin Total followers: 24528
User: johanwirfalt Total followers: 15813
User: ElizabethHarris Total followers: 14333

user total per hour Note larger data sets yeild correct values
User: 99nole Max Total tweets for one hour: 1
User: AngryLogician Max Total tweets for one hour: 1
User: Anita_Wahine Max Total tweets for one hour: 1
User: AnsareSummers Max Total tweets for one hour: 1
User: BAttanasio Max Total tweets for one hour: 1
User: BeatleJeff Max Total tweets for one hour: 1
User: Bladeisspooky Max Total tweets for one hour: 1
User: Blake_R95 Max Total tweets for one hour: 1
User: Boggskm1 Max Total tweets for one hour: 1
User: BonnieJoy1159 Max Total tweets for one hour: 1

user total tweets Note larger data sets yeild correct values
User: 99nole Total tweets: 1
User: AngryLogician Total tweets: 1
User: Anita_Wahine Total tweets: 1
User: AnsareSummers Total tweets: 1
User: BAttanasio Total tweets: 1
User: BeatleJeff Total tweets: 1
User: Bladeisspooky Total tweets: 1
User: Blake_R95 Total tweets: 1
User: Boggskm1 Total tweets: 1
User: BonnieJoy1159 Total tweets: 1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages