【发布时间】:2016-07-23 12:01:12
【问题描述】:
您将如何插入对转发的帖子点赞以及关注发布的用户的功能。
naughty_words = [" -RT"]
good_words = ["CSGO", "skins", "csgo giveaway" "csgogiveaway", "CSGOGiveaway", "Giveaway"]
filter = " OR ".join(good_words)
blacklist = " -".join(naughty_words)
keywords = filter + blacklist
twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
search_results = twitter.search(q=keywords, count=20)
try:
for tweet in search_results["statuses"]:
try:
twitter.retweet(id = tweet["id_str"])
except TwythonError as e:
"print e"
except TwythonError as e:
"print e"
【问题讨论】:
标签: python twitter bots twython