We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ここに一覧がある。
The text was updated successfully, but these errors were encountered:
まずはRSS化からかな?
Sorry, something went wrong.
愛媛新聞とNHK松山のTwitterの投稿をRT 他のところはほとんど記事ないので
import twitter import datetime from pytz import timezone api = twitter.Api( consumer_key='', consumer_secret='', access_token_key='', access_token_secret='') user_lists = ['ehime_np', 'nhk_matsuyama'] text_lists = ['愛媛豪雨災害', '西日本豪雨'] # タイムゾーン取得 for user_id in user_lists: tweets = api.GetUserTimeline(screen_name=user_id) for tweet in tweets: # 投稿日時 dt_date = datetime.datetime.strptime( tweet.created_at, '%a %b %d %H:%M:%S %z %Y').astimezone( timezone('Asia/Tokyo')) # 一時間前 dt_now = datetime.datetime.now( timezone('Asia/Tokyo')) - datetime.timedelta(hours=1) if dt_date > dt_now: # ツイート分の中にリストの文字があるか for i in text_lists: if i in tweet.text: # リツイート済みか if not tweet.retweeted: # リツイート api.PostRetweet(tweet.id) print(tweet.text)
No branches or pull requests
ここに一覧がある。
The text was updated successfully, but these errors were encountered: