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
<video id="videoInput" width="640px" height="480px" autoplay></video> | |
<img id="img" src="" style="display: none" /> | |
<canvas width="440px" height="580px" style="display:none;"></canvas> |
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
post '/voice.json' do | |
t = Tropo::Generator.new | |
t.ask :name => 'digit', | |
:timeout => 60, | |
:say => {:value => "Hello! What year were you born?"}, | |
:choices => {:value => "[4 DIGITS]"} | |
t.on :event => 'continue', :next => '/continue.json' |
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
toArray = [] | |
$smsToken = '' | |
$phoneNumber = '' | |
get '/text' do | |
toArray.each do |element| | |
callSmsScript("Hi", element) | |
sleep(5) | |
end |
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
Show hidden characters
[ | |
{ | |
"class": "sidebar_container", | |
// right border | |
"layer0.tint": [84,84,84], | |
"layer0.opacity": 1.0, | |
"layer0.draw_center": false, | |
"layer0.inner_margin": [0, 0, 1, 0], | |
"content_margin": [0, 0, 1, 0] | |
}, |
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
window.onload = function() { | |
/* ip address of arduino */ | |
var URL = "00.0.0.0"; | |
var lightDiv = $('#lightbulbContainer'); | |
/* find out current state of the light and adjust the UI accordingly */ | |
$.ajax({ | |
type: "GET", | |
url: URL+"/led=-1" |
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
void printWebResponse(WiFiClient client, String lightStatus) { | |
Serial.println(); | |
// so the http request has ended and we can send a reply | |
// send a standard http response header | |
client.println("HTTP/1.1 200 OK"); | |
client.println("Access-Control-Allow-Origin: *"); | |
client.println("Content-Type: text/html"); | |
client.println(); | |
client.println("{\"status\":\""+lightStatus+"\"}"); | |
} |
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
/* changes the light or reports its status */ | |
String changeLight(int val) { | |
/* turn light on */ | |
if(val== 1) { | |
digitalWrite(pin, HIGH); | |
lightStatus = "on"; | |
/* turn light off */ | |
} else if(val==0) { | |
digitalWrite(pin, LOW); | |
lightStatus = "off"; |
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
while (client.connected()) { | |
if (client.available()) { | |
if(finder.find("GET /")) { | |
while(finder.findUntil("led", "\n\r")) { | |
char type = client.read(); | |
int val = finder.getValue(); | |
lightStatus = changeLight(val); | |
} | |
} | |
//pass a simple http response to the browser |
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
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'tropo-webapi-ruby' | |
require 'net/http' | |
set :public_folder, 'public' | |
tropoToken = "" | |
#phone numbers to send messages from | |
fromArray = ['9999999999','9999999999', '9999999999'] |
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
/* https://github.com/tropo/tropo-webapi-node */ | |
var tropowebapi = require('tropo-webapi'); | |
/* Express framwork http://expressjs.com */ | |
var express = require('express'); | |
/* http://mongoosejs.com/ */ | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/track'); | |
mongoose.connect(URI); | |
//connect to mongodb |