From 128f727b833988e40086b69762d45b91ca3f6799 Mon Sep 17 00:00:00 2001 From: "thealok@gmail.com" Date: Thu, 2 May 2013 21:35:36 -0400 Subject: [PATCH] Add support for PushBullet https://www.pushbullet.com/ --- push.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/push.cpp b/push.cpp index f233264..f95022c 100644 --- a/push.cpp +++ b/push.cpp @@ -251,6 +251,26 @@ class CPushMod : public CModule params["title"] = message_title; params["uri"] = message_uri; } + else if (service == "pushbullet") + { + if (options["username"] == "" || options["secret"] == "") + { + PutModule("Error: username (device id) or secret (api key) not set"); + return; + } + + service_host = "www.pushbullet.com"; + service_url = "/api/pushes"; + + // BASIC auth, base64-encoded APIKey: + service_auth = options["secret"] + CString(":"); + service_auth.Base64Encode(); + + params["device_id"] = options["username"]; + params["type"] = "note"; + params["title"] = message_title; + params["body"] = message_content; + } else if (service == "boxcar") { if (options["username"] == "") @@ -1039,6 +1059,10 @@ class CPushMod : public CModule { PutModule("Note: Notifo requires setting both 'username' and 'secret' options"); } + else if (value == "pushbullet") + { + PutModule("Note: Pushbullet requires setting both 'username' (to device id) and 'secret' (to api key) options"); + } else if (value == "boxcar") { PutModule("Note: Boxcar requires setting the 'username' option");