Skip to content

Commit

Permalink
add the python get
Browse files Browse the repository at this point in the history
  • Loading branch information
Phodal Huang committed Sep 4, 2014
1 parent ed62e59 commit f8bf4c9
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions python/get.py
@@ -1,17 +1,6 @@
#!/usr/bin/env python
import json
import urllib2
import serial
import time

url="http://b.phodal.com/athome/1"

while 1:
try:
date=urllib2.urlopen(url)
result=json.load(date)
status=result[0]['led1']
print result
except urllib2.URLError:
print "Bad URL or timeout"
import requests

url = "http://b.phodal.com/athome/1"
r = requests.get(url)
print r.text

0 comments on commit f8bf4c9

Please sign in to comment.