如何在 tweepy(而不是 t.co 链接)中打印出完整的 url?以下代码打印出“这是一个测试链接http://t.co/93Hme7Jv 90210”,即使 twitter.com 显示“这是一个测试链接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