with open('twit/example.json', encoding='utf8') as json_data:
for line in json_data:
try:
dataText = json.loads(line)
except ValueError:
continue
for a in dataText:
我有一個包含推特ID列表的文件,我想要檢索這些推文。該文件包含超過10萬個微博和Twitter的API允許僅檢索100 api = tweepy.API(auth)
good_tweet_ids = [i for i in por.TweetID[0:100]]
tweets = api.statuses_lookup(good_tweet_ids)
for tweet in tweets:
這是我的代碼: mediaID = 877121579854856193L print mediaID response = "here's a pic" b = api.send_media(user_id =status.direct_message['sender_id'], text =response, attachment={'type':'media','media_id': med