#コンテンツ応用論2017 で30ツイートつぶやくやつ
import tweepy | |
from datetime import datetime, timezone | |
# ここらへん入れてね | |
auth = tweepy.OAuthHandler('', '') | |
auth.set_access_token('', '') | |
api = tweepy.API(auth) | |
tag = '#コンテンツ応用論2017' | |
now_day = datetime.now(timezone.utc).day | |
while True: | |
text = input() + ' ' + tag | |
api.update_status(text) | |
print("ツイートを送信しました") | |
count = 0 | |
# 講義当日以外につぶやくならここらへん書き換えてね | |
for status in api.user_timeline(count=200): | |
status_day = status.created_at.day | |
if now_day == status_day and tag in status.text: | |
count = count + 1 | |
if 30 - count > 0: | |
print('残り' + str(30 - count) + 'ツイートです') | |
else: | |
print(str(count) + 'ツイート目です') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment