rb-airgram provides a convenient wrapper around all of the current AirGram API methods, including those that require authentication.
Ruby
Latest commit c29544b Mar 20, 2012 Jake Auswick cleanup
Permalink
Failed to load latest commit information.
lib cleanup Mar 20, 2012
README.md initial commit Mar 20, 2012
airgram.gemspec initial commit Mar 20, 2012
rb-airgram-0.0.3.gem initial commit Mar 20, 2012

README.md

#Ruby AirGram Client

This is an unofficial wrapper for the AirGram notifications service. It provides a wrapper to interact with both the guest and the authenticated methods.

###Installation

gem install rb-airgram

###Usage

You can either initialize the client with the username and password set, or if you are only planning on using the guest sending function, you can initialize it with no parameters.

require 'airgram'

# Without authentication
client = Airgram.new

# Send a notificiation with no authentication needed (url is optional)
client.send_as_guest("recipient@email.com", "Some awesome message", "http://www.bbc.com")

# Auth needed for below functions
# Username = Service Key
# Password = Service Secret
client = Airgram.new(:username => "XXXX", :password => "XXXX")

# Subscribe a new user
client.subscribe("recipient@email.com")

# Send notification to subscribed user (url is optional)
client.send("recipient@email.com", "Some awesome message", "http://www.bbc.com")

# Send notification to EVERY subscribed user (url is optional)
client.broadcast("Some awesome message", "http://www.bbc.com")

See AirGram API Docs for more information.

All methods return either true / false depending on whether the notification request succeeds.