Skip to content

Instantly share code, notes, and snippets.

@nkwhr
Created April 2, 2014 16:24
Show Gist options
  • Save nkwhr/9937536 to your computer and use it in GitHub Desktop.
Save nkwhr/9937536 to your computer and use it in GitHub Desktop.
#!perl
use sane;
use Config::Pit;
use LWP::UserAgent;
die unless @ARGV;
my $message = $ARGV[0];
my $config = pit_get('pushover');
my $ua = LWP::UserAgent->new();
my $res = $ua->post(
"https://api.pushover.net/1/messages.json", [
"token" => $config->{APP_TOKEN},
"user" => $config->{USER_KEY},
"message" => $message,
"device" => "iPhone5",
"title" => "test",
]);
if ($res->is_success) {
say $res->content;
} else {
say $res->status_line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment