Skip to content

Instantly share code, notes, and snippets.

@jacobhak
Last active December 14, 2015 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jacobhak/4996785 to your computer and use it in GitHub Desktop.
Save jacobhak/4996785 to your computer and use it in GitHub Desktop.
ruby script for Pushover, called from rtorrent on download complete, expects torrent name as first argument
require "net/https"
url = URI.parse("https://api.pushover.net/1/messages")
req = Net::HTTP::Post.new(url.path)
req.set_form_data({
:token => "application_api_key", #replace with your api key
:user => "the_user_key", #replace with your user key
:message => "Torrent finished: "+ARGV[0],
})
res = Net::HTTP.new(url.host, url.port)
res.use_ssl = true
res.verify_mode = OpenSSL::SSL::VERIFY_PEER
res.start {|http| http.request(req) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment