def get_tweets(counter):
blacklist = get_blacklist()
keywords = "rt2win OR retweet to win OR Gewinnspiel OR Verlosung -filter:retweets AND -filter:replies"
search_results = twitter.search(q=keywords, result_type= "recent", count=counter)
tweet_ids = []
try:
for tweet in search_results["statuses"]:
add_tweet = True
for name in blacklist:
tweeter = tweet["user"]["screen_name"]
if (name.rstrip('\n') == tweeter):
add_tweet = False
if (add_tweet == True):
tweet_ids.append(str(tweet["id_str"]))
except TwythonError as e:
print e
return tweet_ids
#retweet tweets from task-list, follow users and log actions
评论列表
文章目录