Skip to content

Instantly share code, notes, and snippets.

@fujieda
Created May 19, 2017 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujieda/aa4510a4e3b84810cc1cbcb8eefd90fa to your computer and use it in GitHub Desktop.
Save fujieda/aa4510a4e3b84810cc1cbcb8eefd90fa to your computer and use it in GitHub Desktop.
Push a note to all devices via PushBullet
using System.Net;
using System.Text;
namespace KancolleSniffer
{
public class PushBullet
{
public static void PushNote(string token, string title, string body)
{
using (var wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/json";
wc.Credentials = new NetworkCredential(token, "");
wc.Encoding = Encoding.UTF8;
wc.UploadString("https://api.pushbullet.com/v2/pushes",
$"{{ \"type\": \"note\", \"title\": \"{title}\", \"body\": \"{body}\" }}");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment