Skip to content

Instantly share code, notes, and snippets.

@Yuiki
Created October 23, 2017 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuiki/38ebca4ebae3197ae20571e71f201164 to your computer and use it in GitHub Desktop.
Save Yuiki/38ebca4ebae3197ae20571e71f201164 to your computer and use it in GitHub Desktop.
#コンテンツ応用論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