Yue1Harriet1 / TorontoTweetsAnalysis

Dinky is a Jekyll theme for GitHub Pages

Home Page:https://pages-themes.github.io/dinky/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Analyze Tweets in the Toronto Area

  1. Scrape tweets with the keyword 'toronto'

!pip install tweepy==3.3.0
import tweepy
from tweepy import OAuthHandler
 
consumer_key = '7LaZr3GMUpeZGfeldeRRyhf4g'
consumer_secret = 'j28Qn4bzfLTAaURVbo8myyabBR60CSJ9hnuf1KkRKpKl5C30M3'
access_token = '55717701-rkG9z0elwMusFlgbSFomLVXIAzcYMUTrn5BCPwM3l'
access_secret = 'L5hicGOH8ewvaerUA8spfJEOrQmL4yD8mBeW77NqXM1i8'
 
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
 
api = tweepy.API(auth)
for status in tweepy.Cursor(api.home_timeline).items(10):
    # Process a single status
    print(status.text)
#tweepy.Cursor(api.search, q='cricket', geocode="43.6532,-79.3832,1km").items(10)

cursor = tweepy.Cursor(api.search, q='toronto').items(10)

for tweet in cursor:
   print(tweet.created_at, tweet.text, tweet.lang)

About

Dinky is a Jekyll theme for GitHub Pages

https://pages-themes.github.io/dinky/

License:Creative Commons Zero v1.0 Universal


Languages

Language:Jupyter Notebook 59.9%Language:SCSS 26.8%Language:HTML 7.2%Language:Shell 2.7%Language:Ruby 2.1%Language:JavaScript 1.4%