Things used in this project

Hardware components:
Pinoccio Scout
×1
Button
×1
11026 02
Jumper wires (generic)
×1

Code

file_6548.txtJavaScript
        var pinocc = require("pinoccio");
var ordrinapi = require("ordrin-api");
require('console.alert')();

var api = pinocc("{{ pinoccio api }}");

var api_secret_key = "{{ ordr.in api }}";

var ordrin = new  ordrinapi.APIs(api_secret_key, ordrinapi.TEST); // When you're ready to start using the program, change "ordrinapi.TEST" to "ordrinapi.PRODUCTION"

// This is to clear the screen, to only have the console alert
var lines = process.stdout.getWindowSize()[1];
for(var i = 0; i < lines; i++) {
	console.log('\r\n');
}

console.alert("Waiting for Pizza time");

var args = {
	rid: "27624",
	em: "gavin_dinubilo@mail.tmcc.edu",
	tray: "22991598/1",
	tip: "3.00",
	first_name: "Gavin",
	last_name: "Dinubilo",
	phone: "",
	zip: "89501",
	addr: "105 Arlington avenue",
	city: "Reno",
	state: "NV",
	card_name: "Gavin A Dinubilo",
	card_number: "4111111111111111",
	card_cvc: "123",
	card_expiry: "02/2016",
	card_bill_addr: "105 Arlington avenue",
	card_bill_city: "Reno",
	card_bill_state: "NV",
	card_bill_zip: "89501",
	card_bill_phone: "7753762948",
	delivery_date: "ASAP"
};

var s = api.sync();

s.on("data", function(data){
	data = data.data;
	if(data.type === "digital" && data.troop === '1' && data.scout === '1'){
		if (data.value.state[0] === 0) {
			orderPizza();	
		}
	}
});

function orderPizza() {
	for(var i = 0; i < lines; i++) {
    		console.log('\r\n');
	}
	console.alert("PIZZA TYME!!!!!");
	ordrin.order_guest(args, function(error, data){
		for(var i = 0; i < lines; i++) {
    		console.log('\r\n');
		}
		console.alert("Pizza will be here ASAP!!");
	});
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

    DHT22 Sensor and Pinoccio
    • 1,613
    • 5

    Full instructions

    Using DHT22 Temperature and Humidity sensor with Pinoccio

    Mesh Your Brain
    • 3,464
    • 22

    Full instructions

    Build your own Internet of Brains with this wireless EEG hack!

    Human Presence Detection & Visualization
    • 1,064
    • 9

    Full instructions

    Team Cogitate's social radar displays people nearby as a set of glowing orbs

    Hideous Arc Reactor Sweater (WIP)
    • 813
    • 6

    Work in progress

    Power through the holiday slump with this festive, EEG-reactive sweater!

    Pinoccio Craft
    • 375
    • 5

    Full instructions

    Send Bitlash Pinoccio Commands through Minecraft.

    Solar Powered Pinoccio Scout
    • 1,079
    • 9

    Run your wireless mesh forever with Adafruit's solar LiPo charger

    Add projectSign up / Login