Skip to content

Instantly share code, notes, and snippets.

@hyperobject
Last active October 28, 2015 00:35
Show Gist options
  • Save hyperobject/21358fdb7176ff5a5769 to your computer and use it in GitHub Desktop.
Save hyperobject/21358fdb7176ff5a5769 to your computer and use it in GitHub Desktop.
Scratch->Phone
import requests
import time
num = 0
user = "technoboy10"
key = "get your own! :P"
message = "event name here"
scratch = 'https://api.scratch.mit.edu/proxy/users/' + user + '/activity/count'
ifttt = 'https://maker.ifttt.com/trigger/' + message + '/with/key/' + key
while True:
r = requests.get(scratch).json()['msg_count']
if r != num and r != 0:
num = r
requests.get(ifttt, params={"value1":r})
time.sleep(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment