Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phodal Huang
committed
Sep 4, 2014
1 parent
ed62e59
commit f8bf4c9
Showing
1 changed file
with
4 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |