0
Twython(または可能であればtweepy)を使用して、私が持っているツイートidsのリストからテキスト(およびその他の情報)を生成しようとしています。python - Twitter API - idsのリストからつぶやきを取得する
私は複数でそれを行う方法、およびb)は、ユーザの説明など、他の情報を引き出す方法)Aを、私はわからない、1つのIDでそれをやってのけることができ、場所など
ここでは私です私はまた別の同様の質問を見つけ
list_of_tweets = ["928549518659989505", "928635241677324288" ]
twitter = Twython(consumer_key, consumer_secret,access_token, access_token_secret)
tweet = twitter.show_status(id=__notsure__)
print(tweet['text'])
コード(ユーザー名のために、しかし、そのテキストを取得するのは簡単)、次の解決策提供する:
from twython import Twython
#Auth steps
twitter = Twython(AUTH)
samplefollower = ["259784090","136953436","1219150098"]
#We create a comma separated string from the previous list
comma_separated_string = ",".join(samplefollower)
#Now, we query twitter with the comma separated list
output = twitter.lookup_user(user_id=comma_separated_string)
username_list=[]
#Loop through the results
for user in output:
username_list.append(user['screen_name'])
print(username_list)
しかし私にエラーを与えます:あなたがtwythonまたはtweepyする結婚されていない場合は
TwythonError: Twitter API returned a 404 (Not Found), No user matches for specified terms.
私は実際には平均時間でそれを解決しますが、あなたはあまりにも動作します! – blacksatius
あなたの解決策 – Adders