EID Prototype App

Our EID project was to turn a light on and off over the internet.

The purpose of this script is to take commands from a user in the form
of “ON” or “OFF” and send those commands to another Internet service
through the SparkCloud API.

To accomplish that, the script is split into 3 functions,

1) getCommand. This function reads the latest command submitted by a
user into the spreadsheet. It is very easy for users to submit commands
using a Google Form.

2) post2spark. Although this function is rolled into the above, its
purpose is to take the latest command and literally send it to the
SparkCloud using an HTTP POST request. To verify, in line 29, this code
also logs the response from that server.