假设我
tweets = api.home_timeline()
它会返回一个列表,其中包含20个最近发布在我的时间轴上的状态对象。如果我这样做了
for tweet in tweets:
print tweet.text
它打印20条消息。是否可以检索状态发布的时间?状态对象还有哪些其他属性?需要帮助。
答案 0 :(得分:5)
tweet = tweets[0]
print tweet.created_at
输出将是一个日期时间对象。 E.g:
(Pdb) tweet.created_at
datetime.datetime(2012, 6, 3, 20, 9, 24)
对于所有属性,请参阅Twitter API docs。 Tweepy docs也会让您感兴趣。