Skip to content

Instantly share code, notes, and snippets.

@iorionda
Created May 9, 2013 02:17
Show Gist options
  • Select an option

  • Save iorionda/5545107 to your computer and use it in GitHub Desktop.

Select an option

Save iorionda/5545107 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
# -*- coding: utf-8 -*-
# prowl_notification.rb
require 'prowl'
KEY_TITLE = 'PROWL_NOTICE_TITLE'
KEY_DESC = 'PROWL_NOTICE_DESC'
API_KEY = 'PROWL_API_KEY'
class ProwlNotification
def initialize
@prowl = Prowl.new(apikey: API_KEY,
application: 'ProwlNotification')
end
def do(title, description)
title ||= ARGV[0] || ''
description ||= ARGV[1] || 'process has been finished.'
@prowl.add(event: title, description: description)
end
end
if __FILE__ == $0
prowl_notification = ProwlNotification.new
prowl_notification.do(ENV[KEY_TITLE],ENV[KEY_DESC])
end
@iorionda
Copy link
Copy Markdown
Author

iorionda commented May 9, 2013

Prowl
ruby-prowl
gem install prowl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment