Skip to content

Instantly share code, notes, and snippets.

View guglielmino's full-sized avatar

Fabrizio Guglielmino guglielmino

View GitHub Profile
@guglielmino
guglielmino / PushettaEthernetShield
Last active August 29, 2015 14:14
A sample to use Pushetta API from Arduino with Ethernet shield
#include <SPI.h>
#include <Ethernet.h>
/////////////////
// MODIFY HERE //
/////////////////
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x19 }; // Be sure this address is unique in your network
char APIKEY[] = "ffaabb444f1177772222f7243534badaanaa1100"; // Put here your API key
char CHANNEL[] = "my channel"; // and here your channel name
boolean DEBUG = true;
from pushetta import Pushetta
API_KEY="00112233445566778899aabbccddeeff00112233"
p=Pushetta(API_KEY)
p.pushMessage("raspi", "Hello World"")
@guglielmino
guglielmino / gist:60cfb8ef4cf47ec9a629
Created January 24, 2015 15:39
Sample code for Pushetta
import urllib2
import json
def sendNotification(token, channel, message):
data = {
"body" : message,
"message_type" : "text/plain"
}
req = urllib2.Request('http://api.pushetta.com/api/pushes/{0}/'.format(channel))