Using Pushover with Electric Imp

I just made a little function to easy send messages with Pushover, directly from the Electric Imp. With the agent it is no longer needed to have a web server doing the forwarding.

Agent:
`function pushover(message)
{
local user = “insert user token here”;
local token = “insert application token here”;
local priority = 1; // -1 = low, 0 = normal, 1 = high

local request = http.post(“https://api.pushover.net/1/messages.json”, {“Content-Type”: “application/x-www-form-urlencoded”}, “token=” + token + “&user=” + user + “&message=” + message + “&priority=” + priority);
local response = request.sendsync();
server.log("Response: " + response.body);
}
pushover(“This message was send from the Electric Imp Agent”);`

The code can also be found here http://captain-slow.dk/2014/01/03/using-pushover-with-electric-imp/ where there also are a bit more information and which is also where I will post the newest code, if I change something.

Thanks for sharing. I have a couple of projects on the back burner that could make use of this. It might be useful to add the sound parameter to your function. I use that a lot to differentiate between notifications.