Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (68 sloc) 2.93 KB
const html = @"<!DOCTYPE html>
<html lang=""en"">
<meta charset=""utf-8"">
<meta name=""viewport"" content=""width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"">
<meta name=""apple-mobile-web-app-capable"" content=""yes"">
<link rel=""apple-touch-icon"" sizes=""114x114"" href="""">
<script src=""""></script>
<script src=""""></script>
<script src=""""></script>
<link href=""//"" rel=""stylesheet"">
<link href=""//"" rel=""stylesheet"">
<script type=""text/javascript"">
function sendToImp(value){
if (window.XMLHttpRequest) {devInfoReq=new XMLHttpRequest();}
else {devInfoReq=new ActiveXObject(""Microsoft.XMLHTTP"");}
try {'POST', document.URL, false);
} catch (err) {
console.log('Error parsing device info from imp');
function small(){
function medium(){
function large(){
<div class='container'>
<div class=''>
<h1 class='text-center'>SnackBot!!</h1>
<div class='lead text-center'>Why not have some candy?</div>
<div class='well' style='max-width: 400px; margin: 0 auto 10px;'>
<button class='btn btn-primary btn-large btn-block' onclick='small()'>Small</button>
<button class='btn btn-primary btn-large btn-block' onclick='medium()'>Medium</button>
<button class='btn btn-primary btn-large btn-block' onclick='large()'>Large</button>
if (request.body == "") {
res.send(200, html);
if(request.body == "small"){
server.log("Agent: Dispensing Small");
device.send("dispense", 0.4);
}else if(request.body == "medium"){
server.log("Agent: Dispensing Medium");
device.send("dispense", 0.8);
}else if(request.body == "large"){
server.log("Agent: Dispensing Large");
device.send("dispense", 1.0);
server.log("Unrecognized Body: "+request.body);
res.send(200, "");
You can’t perform that action at this time.