使用Tweeppy PYTHON

时间:2015-11-06 15:21:16

标签: python api

我试图用他们的评论来显示来自用户的转推(如果他们这样做),但当我将其保留为我的文本文件格式时,显示如下:

Status(contributors=None, truncated=False, text=u'de Anahi con @atwn #Qun', is_quote_status=False, in_reply_to_status_id=None, id=6624564125782016L, favorite_count=0, api=, author=User(followrequest_sent=False, has_extended_profile=True, profile_use_background_image=True, json={u'followrequest_sent': False, u'has_extended_profile': True, u'profile_use_background_image': True, u'default_profile_image': False, u'id': 148061558, u'profile_background_image_url_https': u'https://pbs.twimg.com/profile_background_images/624758616149504/NZ68rSC.jpg', u'verified': False, u'profile_text_color': u'333333', u'profile_image_url_https': u'https://pbs.twimg.com/profile_images/66245414768646632/4YmbieuO_normal.jpg', u'profile_sidebar_fill_color': u'EFEFEF', u'entities': {u'description': {u'urls': []}}, u'followers_count': 2763, u'profile_sidebar_border_color': u'FFFFFF', u'id_str': u'14801558',

当然,它更广泛,不知道他们是否能够帮助只展示我所需要的是转发的人,拥有该人的有多少粉丝以及其他人。 它表明,但正如我所说,显示了所有这些并且不需要它。

我在那里留下一些代码:

api = tweepy.API(auth)
hasht=api.search(buscar_term)
data = api.get_user(username)
for datos in hasht:
guardar=datos.split(',')
archivo= codecs.open('archivo.txt','a')
archivo.write(str(datos))
archivo.close()
print("\n")
print("\n")
print("\n")
print("\n")
print("\n")
print("\n")
print(("Hashtags and Retweets"), str(hasht))

感谢。

0 个答案:

没有答案