Ruby Gem for sending SMS through the Mediaburst API
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
ISC-LICENSE
README.md
Rakefile
mediaburst.gemspec

README.md

Mediaburst API Gem

The Mediaburst Gem is the fastest way of integrating the Mediaburst API into your own ruby applications.

Installation

Install the gem as normal:

sudo gem install mediaburst

The Mediaburst gem also relies on Nokogiri for XML parsing.

Usage

Create an instance of the Mediaburst client:

client = Mediaburst::API.new('username', 'password')

Send an SMS:

response = client.send_message('441234567890', 'My test message')

Send a message to several numbers:

response = client.send_message(['441234567890', '441234567891', '441234567892'], 'My test message')

Send a long message to several numbers using the concat option:

options = {
  :concat => 3
}

response = client.send_message(['441234567890', '441234567891', '441234567892', '44'], SOME_LONG_MESSAGE, options)

Send a long message with a custom from address from option:

options = {
  :concat => 3,
  :from => 'RubyDemo'
}

response = client.send_message(['441234567890', '441234567891', '441234567892', '44'], SOME_LONG_MESSAGE, options)

Check the response for errors:

y response
=> ---
   "441234567890": true
   "441234567891": true
   "441234567892": true
   "44": 10

On error, the value of the key referenced by the number will equal the error code returned from Mediaburst.

Development

The source for the gem is hosted on GitHub for you to peruse, fork and contribute to.

To enable us to easily manage your contributions, please submit your pull requests as single commits that include tests to show your changes working as normal. Please do not change the version number - we'll take care of that as we merge your changes.

License

Copyright © 2011 Matthew Hall, released under the ISC license. All trademarks and IP remain the property of their respective owners.