helm/bin/prowl

26 lines
492 B
Plaintext
Raw Normal View History

2014-08-01 15:15:37 -07:00
#!/usr/bin/env ruby
# A quick script for sending myself prowl notifications
require 'prowl'
APIKEY_FILE = File.expand_path("~/.prowl-apikey")
if ARGV.length != 3
p "Usage: prowl [appname] [title] [message]"
exit
end
if not File.exists? APIKEY_FILE
p "#{APIKEY_FILE} does not exist. Create it!"
exit
end
api_key = File.read(APIKEY_FILE).strip
Prowl.add(
:apikey => api_key,
:application => ARGV[0],
:event => ARGV[1],
:description => ARGV[2]
)