Skip to content

Instantly share code, notes, and snippets.

Created April 17, 2014 13:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/10982308 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'pushbullet'
client = Pushbullet::Client.new("#{ENV['NZBOP_PUSH_PUSH_SH_API']}")
message = <<EOF
Category: #{ENV['NZBPP_CATEGORY']}
---------------------------------
#{ENV['NZBPP_NZBNAME']}
---------------------------------
Status
Repair:#{ENV['NZBPP_PARSTATUS'] != 1 ? 'Good' : 'Failed'} \
Unpack:#{ENV['NZBPP_UNPACKSTATUS'] != 1 ? 'Good' : 'Failed'}
EOF
client.push_note_to("#{ENV['NZBOP_PUSH_PUSH_SH_EMAIL']}", 'Download Finished', "#{message}")
exit 93
#!/bin/bash
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Send pushbullet notification.
#
# This script sends a pushbullet notification when the job is finished.
#
# NOTE: RVM with at least 1 installed ruby is required
#
# The push bullet gem must be installed as well
##############################################################################
### OPTIONS ###
# RVM ruby version to use
#
# INFO: e.g. 2.1.1
#Ruby=
# Pushbullet API key
#Api=
# Email address of recipient
#
# INFO: Recipient must add you as a friend
#Email=
# Path to your home directory
#
# INFO: e.g. /Users/John
#User=
### NZBGET POST-PROCESSING SCRIPT ###
if [[ -s $NZBOP_PUSH_PUSH_SH_USER/.rvm/scripts/rvm ]]; then
. $NZBOP_PUSH_PUSH_SH_USER/.rvm/scripts/rvm
fi
rvm "$NZBPO_RUBY"
exec ruby "$NZBOP_ScriptDir"/push/push.rb
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment