Skip to content

Instantly share code, notes, and snippets.

@trianglegrrl
Created July 22, 2015 01:12
Show Gist options
  • Save trianglegrrl/23d3b63cf1f562fb1e24 to your computer and use it in GitHub Desktop.
Save trianglegrrl/23d3b63cf1f562fb1e24 to your computer and use it in GitHub Desktop.
SU GSP NCS API WTF
import os
import requests
import json
# Photoresistor - light levels
#results = requests.get('https://api.particle.io/v1/devices/53ff6e066678505543482367/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Sound sensor
#results = requests.get('https://api.particle.io/v1/devices/54ff66066678574935400667/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Tilt sensor
#results = requests.get('https://api.particle.io/v1/devices/54ff70066678574953520267/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Force sensor
results = requests.get('https://api.particle.io/v1/devices/54ff70066678574942581067/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Print the results... or you can make a decision about the value and post to Slack!
json = results.json()
print(json['result'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment