如何解决如何使用 tweepy 转发带有特定主题标签的消息?
我遵循了本指南,但由于某种原因这不起作用。它说他们被转发了,但我在机器人帐户上没有看到转发。
import tweepy
import json
from time import sleep
# from credentials import *
with open('config.json') as config_file:
config = json.load(config_file)
auth = tweepy.OAuthHandler(config['consumer_key'],config['consumer_secret'])
auth.set_access_token(config['access_token'],config['access_token_secret'])
api = tweepy.API(auth)
for tweet in tweepy.Cursor(api.search,q=('#philzafanart -filter:retweets'),lang='en').items(100000000):
try:
# Add \n escape character to print() to organize tweets
print('\nTweet by: @' + tweet.user.screen_name)
# Retweet tweets as they are found
tweet.retweet()
print('Retweeted the tweet')
except tweepy.TweepError as e:
print(e.reason)
except StopIteration:
break
解决方法
等等我搞砸了,忽略这个。这是从我的主帐户转发的,因为我忘记更新密钥了,有趣
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。