Twitter List gathering for me

import tweepy
from tweepy import OAuthHandler

API_KEY = ”
API_SECRET = ”
ACCESS_KEY = ”
ACCESS_SECRET = ”

oAuth = tweepy.OAuthHandler(API_KEY, API_SECRET)
oAuth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth_handler = oAuth, api_root = ‘/1.1’)

if __name__ == “__main__”:
userID = ‘xxxxxxx’
user = api.get_user(userID)
timeline = api.user_timeline(userID, count=400)

# PRINT USER’S TIMELINE TWEETS
for tweet in timeline:
try:
texts = tweet.text
print(texts)
except AttributeError as e:
print(e)

# PRINT USER’S FRIENDS IDs
for friend in user.friends(count = 200):
print(friend.id)

Advertisements

Author: SK,Seo

Me! Name: SK Seo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s