Skip to content

Instantly share code, notes, and snippets.

@h1dia
Created August 14, 2017 13:41
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 h1dia/c357b4020e2f8d363b7dd84f29a5145c to your computer and use it in GitHub Desktop.
Save h1dia/c357b4020e2f8d363b7dd84f29a5145c to your computer and use it in GitHub Desktop.
from time import sleep
import twitter
api = twitter.Api(consumer_key='X', consumer_secret='X', access_token_key='X',access_token_secret='X')
while True:
f = open("/sys/class/gpio/gpio71/value")
if f.readline().rstrip("\n") == "1":
try:
api.PostUpdate("セロリってなんだかえっちじゃないですか?")
except twitter.error.TwitterError:
pass
f.close()
sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment