I am trying to mine data in a local area.
First I would like to Twython to search all tweets on twitter to find those tweets that contain a particular keyword, and then print those tweets. I have successfully written the few lines of code that do this:
from twython import Twython
TWITTER_APP_KEY = ''
TWITTER_APP_KEY_SECRET = ''
TWITTER_ACCESS_TOKEN = ''
TWITTER_ACCESS_TOKEN_SECRET = ''
t = Twython(TWITTER_APP_KEY, TWITTER_APP_KEY_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET)
search = t.search(q='hello', count=100)
tweets = search['statuses']
for tweet in tweets:
print (tweet['text'], '\n')
Next, I want to generate the user name of the ID that tweeted the text (not just the ID but the actual username), and print it.
After this, I would like to generate the friends list of the particular user, and print it.
How can I get the user name and the friends list?