0
我试图将多个变量传递给Tweepy的api.update_status函数。我试图从光标调用两个变量,当我这样做时只会输出一个变量。将多个变量传递给Tweepy api.update_status
for (id, tweet_id, screen_name, created_at, text) in cursor:
url='https://www.threatminer.org/host.php'
payload={'q': text, 'api': 'True', 'rt': '6'}
headers={
'user-agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}
r=requests.get(url, params=payload, headers=headers)
json_data=r.json()
status_message=json_data['status_message']
status = text and "Was found in a Tweet"
if "Results found." in status_message:
api=tweepy.API(auth)
api.update_status(text, screen_name)
print(text, screen_name)
print(r.url)
print json_data
else:
print('Nothing')
你是什么意思“传递多个变量到api.update_status”?你有两个或更多的变量包含你想发送的文本? –
@RodrigoLeite这是正确的。我有多个包含我想要发送的文本的变量。 –
我提交了一个答案 –