Skip to content

Instantly share code, notes, and snippets.

Created April 16, 2014 14:54
Show Gist options
  • Select an option

  • Save anonymous/10889103 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/10889103 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tv.nzbget</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/nzbget</string>
<string>-D</string>
<string>-c</string>
<string>/Users/Chancho/.nzbget.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
#!/usr/bin/env ruby
`whoami >> /Users/Chancho/test-push.txt`
`ruby -v >> /Users/Chancho/test-push.txt`
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Send pushbullet notification.
#
# This script sends a pushbullet notification when the job is finished.
#
# NOTE: This script requires ruby to be installed on your system.
### OPTIONS
# Pushbullet API key
#Api=
# NOTE: email address of recipient, recipient must add you as a friend
#Email=
### NZBGET POST-PROCESSING SCRIPT ###
##############################################################################
require 'pushbullet'
client = Pushbullet::Client.new("#{ENV['NZBPO_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['NZBPO_EMAIL']}", 'Download Finished', "#{message}")
exit 93
# when Nzbget is start by a launchagent
Chancho
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
# when Nzbget is started from a terminal
Chancho
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment