0
我想轉推前,文件管理器,Twython某些詞。我無法想出一種方法來實現它的功能,而不是過濾掉某些單詞,而是將這些單詞添加到轉發的單詞中。這裏是我的代碼:過濾器鳴叫關鍵字
naughty_words = ["",'"Sign up"', "kindle", "read", "book", "amzn", "amazon"]
good_words = ["Giveaway", ""]
filter = "OR".join(good_words)
blacklist = "-".join(naughty_words)
keywords = filter + blacklist
search_results = twitter.search(q="keywords", count= 5)
try:
for tweet in search_results["statuses"]:
twitter.retweet(id = tweet["id_str"])
time.sleep(15)
except TwythonError as e:
print e
這並沒有解決任何問題。我仍然有同樣的問題:「( – Alex
'贈品或者 - ‘註冊’-kindle - 讀取-book -amzn -amazon'是我提供的一個'GiveawaySign了-kindle - 讀取-book -amzn -amazon。 '是從keywords'的'打印,輸出是在一開始完全不同的遵守[搜索API(https://dev.twitter.com/rest/public/search)確保它的更新正確。我跑它和工作對我罰款。 – Leb
在哪裏我把那東西嗎?我更新了上面的問題,以符合我的變化。你能告訴我,我應該改變的東西具體?(我是新來的這個東西「) – Alex