Created
January 4, 2015 21:14
-
-
Save dwblair/b714e5bc8efa810cf00c to your computer and use it in GitHub Desktop.
posting to sparkfun's phant service
This file contains hidden or 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
import urllib2 | |
from random import randint | |
import time | |
publicKey='9JyZ00pQg7iDyOYaWDrv' | |
privateKey='xz4y55b8R1tbm5owZb47' | |
while 1: | |
r = randint(1,10)/10. | |
print r | |
sentence = 'https://data.sparkfun.com/input/'+str(publicKey)+'?private_key='+str(privateKey)+'&rando='+str(r) | |
url_response = urllib2.urlopen(sentence) | |
print url_response | |
time.sleep(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment