Tweepy 挖矿结果刚好在推文中间以“...”结尾
Tweepy mining result just ends in the middle of the tweet with "..."
你好,我正在使用 tweepy 和以下代码挖掘推文
api_key = ""
api_secret = ""
consumer_token = ""
consumer_token_secret= ""
auth = tweepy.OAuthHandler(api_key, api_secret)
auth.set_access_token(consumer_token,consumer_token_secret)
api = tweepy.API(auth)
search_words = "new normal -filter:retweets"
date_since = "2020-06-30"
tweets = tweepy.Cursor(api.search,
q=search_words,
lang="id",
since=date_since).items(1000)
with io.open('file.csv', 'w', newline='', encoding="utf-16") as file:
writer = csv.writer(file, quoting=csv.QUOTE_ALL)
writer.writerow(["Comment"])
for tweet in tweets:
writer.writerow([tweet.text])
我注意到当结果是带有图像的推文时,结果恰好在推文的中间以“...”结尾。例如
Bhabinkamtibmas desa Cipurwasari sambangi masyarakat dan berikan Himbauan Kamtibmas serta himbauan new normal pada… https://t.co/*********
New Normal masih bingung apa aja yang harus disiapkan? #sinokkemayu bantu kamu siapkan kebutuhan saat #newnormal ni… https://t.co/*********
有什么解决方案可以让我得到完整的文本吗?
将 tweet_mode=extended
添加到您的 API 通话中。
你好,我正在使用 tweepy 和以下代码挖掘推文
api_key = ""
api_secret = ""
consumer_token = ""
consumer_token_secret= ""
auth = tweepy.OAuthHandler(api_key, api_secret)
auth.set_access_token(consumer_token,consumer_token_secret)
api = tweepy.API(auth)
search_words = "new normal -filter:retweets"
date_since = "2020-06-30"
tweets = tweepy.Cursor(api.search,
q=search_words,
lang="id",
since=date_since).items(1000)
with io.open('file.csv', 'w', newline='', encoding="utf-16") as file:
writer = csv.writer(file, quoting=csv.QUOTE_ALL)
writer.writerow(["Comment"])
for tweet in tweets:
writer.writerow([tweet.text])
我注意到当结果是带有图像的推文时,结果恰好在推文的中间以“...”结尾。例如
Bhabinkamtibmas desa Cipurwasari sambangi masyarakat dan berikan Himbauan Kamtibmas serta himbauan new normal pada… https://t.co/*********
New Normal masih bingung apa aja yang harus disiapkan? #sinokkemayu bantu kamu siapkan kebutuhan saat #newnormal ni… https://t.co/*********
有什么解决方案可以让我得到完整的文本吗?
将 tweet_mode=extended
添加到您的 API 通话中。