如何在 tweepy 中打印完整的 URL(而不是 t.co 链接)?以下代码打印出“this is a test link http://t.co/93Hme7Jv 90210”,尽管 twitter.com 显示“this is a test link http://www.test.com/test 90210”。
import tweepy, random
consumer_key="my_key"
consumer_secret="my_secret"
access_token="my_access"
access_token_secret="my_token"
rand = random.randint(1,999999999)
if __name__ == '__main__':
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
status = tweepy.API(auth)
tweepy.API(auth).update_status('this is a test link http://www.test.com/test %s' % (rand))
user = 'test_user'
for status in tweepy.Cursor(status.user_timeline, id=user).items(20):
print status.text