Code: Select all
printed_ids = []
for tweet in api.mentions_timeline(count = 20): #Get last 20 mentions
if tweet.id not in printed_ids:
printed_ids.append(tweet.id)
print printed_ids
print ""
Good, exactly what I wanted. Now I want to print off the tweet text next to each of the various IDs so I add this code:
Code: Select all
for tweet in api.mentions_timeline(count = 20):
if tweet.id not in printed_ids:
printed_ids.append(tweet.id)
print printed_ids
print ""
for tweet.id in printed_ids:
print "Tweet ID: %d %r" % (tweet.id, tweet.text)
print ""
Thanks for any pointers!