Last active
October 28, 2015 00:35
-
-
Save hyperobject/21358fdb7176ff5a5769 to your computer and use it in GitHub Desktop.
Scratch->Phone
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
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