When I participate in the Barth Festival, I can't enjoy the movie slowly because I don't understand the meaning of having to tweet Barus. This is a problem. What can I do?
So let's use the script we made earlier.
It seems that the timing of the bals is often 1 hour 55 minutes 5 seconds after the start of the main story. Converted to seconds, it's 6955 seconds.
There are many uncertainties such as the time error of hitting the command and where to start the main story, but why not take the plunge and start it as soon as the main story starts?
balstimer.py
#!/user/bin/env python
# -*- coding: utf-8 -*-
from requests_oauthlib import OAuth1Session
import sys, codecs
import threading
C_KEY = "***************************"
C_SECRET = "***************************"
A_KEY = "***************************"
A_SECRET = "***************************"
def Post_msg():
url = "https://api.twitter.com/1.1/statuses/update.json"
params = {
"status": u"Barus!",
"lang": "ja"
}
tw = OAuth1Session(C_KEY,C_SECRET,A_KEY,A_SECRET)
req = tw.post(url, params = params)
if req.status_code == 200:
print u"Eyes ah ah eyes ah ah ah"
else:
print req.status_code
return Post_msg
t=threading.Timer(6955,Post_msg)
t.start()
I wish you all the best of luck.
Recommended Posts