Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Client to control electrical appliances based on Twitter activity.
# Uses Tellstick USB (using Remotestick REST API http://wiki.github.com/pakerfeldt/remotestick/ ) and
# the Twitter API.
import twitter
import time
import httplib
api = twitter.Api()
api = twitter.Api(username='moonhouse', password='secret')
prevstatus = api.GetReplies()[0].id
while 1:
statuses = api.GetReplies()
print statuses[0].id
if(prevstatus != statuses[0].id):
conn = httplib.HTTPConnection("127.0.0.1:8422")
conn.request("GET", "/devices/7/on.xml")
conn.close()
prevstatus = statuses[0].id
time.sleep(120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.