Commit f6266a5f7b3e5cca036a38547372b059858766f3

Authored by sniker
1 parent 6a2d7506

Updates

Showing 1 changed file with 11 additions and 11 deletions   Show diff stats
pushover.pl
... ... @@ -3,19 +3,21 @@ use warnings;
3 3  
4 4 #####################################################################
5 5 # This script sends notifications to your
6   -# iPhone using the Notify My Android API when you are away.
  6 +# phone using the Pushover API when you are away.
7 7 #
8 8 #
9 9 # Commands:
10   -# /set pushover_api_key API_KEY
  10 +# /set pushover_token TOKEN
  11 +# /set pushover_user USER_TOKEN
  12 +# /set pushover_device DEVICE # Send to ALL if left empty
11 13 # /set pushover_general_hilight on/off
12 14 # /set pushover_priority_channel -2 up to 2
13 15 # /set pushover_priority_pm -2 up to 2
14 16 # /set pushover_priority_general -2 up to 2
15 17 # /set pushover_ignore_nettag NETWORKS # Networks in this case is a
16   -# comma separated list of
17   -# network tags that should
18   -# be ignored.
  18 +# comma separated list of
  19 +# network tags that should
  20 +# be ignored.
19 21 #
20 22 # "General hilight" basically referrs to ALL the hilights you have
21 23 # added manually in irssi, if many, it can get really bloated if
... ... @@ -28,8 +30,6 @@ use warnings;
28 30 # Or if you're using Debian GNU/Linux:
29 31 # apt-get update;apt-get install libwww-perl libcrypt-ssleay-perl
30 32 #
31   -# Creds to Kayjay for beta testing, this wouldn't have been
32   -# possible otherwise since I don't own an Android device.
33 33 #
34 34 # eth0 will prevail. || irc.eth0.info
35 35 #
... ... @@ -43,7 +43,7 @@ use vars qw($VERSION %IRSSI);
43 43 use LWP::UserAgent;
44 44 use HTTP::Request::Common;
45 45  
46   -$VERSION = "0.2";
  46 +$VERSION = "0.1";
47 47  
48 48 %IRSSI = (
49 49 authors => "Caesar 'sniker' Ahlenhed",
... ... @@ -85,9 +85,7 @@ sub send_noti {
85 85 [
86 86 token => $options{'token'},
87 87 user => $options{'token'},
88   - if($options{'device'} ne ""){
89   - device => $options{'device'},
90   - }
  88 + device => $options{'device'},
91 89 title => $options{'title'},
92 90 message => $options{'msg'},
93 91 priority => $options{'priority'},
... ... @@ -98,6 +96,8 @@ sub send_noti {
98 96  
99 97 if ($response->is_success) {
100 98 # I guess it worked, eh?
  99 + # Debug:
  100 + Irssi::print("Notification not posted: " . $response->content);
101 101 } else {
102 102 Irssi::print("Notification not posted: " . $response->content);
103 103 }
... ...