hanpa

Pushover glances API call from bash -> perl

Aug 18th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. bash:
  2. send_to_watch.pl "$title" "$text" "$subtext"
  3.  
  4. send_to_watch.pl
  5. #!/usr/bin/perl -w
  6.  
  7. my $title=$ARGV[0];
  8. my $text=$ARGV[1];
  9. my $subtext=$ARGV[2];
  10.  
  11. use LWP::UserAgent;
  12.  
  13. LWP::UserAgent->new()->post(
  14. "https://api.pushover.net/1/glances.json", [
  15. "token" => "xxx",
  16. "user" => "yyy",
  17. "count" => "0",
  18. "title" => $title,
  19. "text" => $text,
  20. "subtext" => $subtext
  21. ]);
Advertisement
Add Comment
Please, Sign In to add comment