--------------------------
Summary
--------------------------
clickatell gem is served to you for sending sms from your ruby application or shell console. This way is only work in linux, BSD and OSX. To use this gem, you will need sign up for an account at the Clickatell website. Once you are registered and logged into your account centre, you should add an HTTP API connection to your account. This will give you your API_ID.
--------------------------
Proof of Concept
--------------------------
- install gem : {$} gem install clickatell
- import or checkout the clickatell trunk repositroy
svn co svn://lukeredpath.co.uk/var/svn/opensource/clickatell/trunk clickatell-trunk
OR
git clone git://github.com/lukeredpath/clickatell.git
- You can now use the library directly. You will need your API_ID as well as your account username and password.
require 'rubygems'
require 'clickatell'
api = Clickatell::API.authenticate('your_api_id', 'your_username', 'your_password')
api.send_message('6285212345678', 'Hello from clickatell & teapoci')
- Full documentation for the API is available in the RDocs. For debugging purposes, the API allows you to view gateway URIs as they are requested, printed to $stdout. You can enable this by turning on debug_mode.
Clickatell::API.debug_mode = true
.
- The Clickatell gem also comes with a command-line utility that will allow you to send an SMS directly from the command-line.
- You will need to create a YAML configuration file in your home directory, in a file called .clickatell that resembles the following:
# ~/.clickatell
api_key: your_api_id
username: your_username
password: your_password
- You can then use the sms utility to send a message to a single recipient:
{$} sms 6285212345678 'Hello from clickatell & teapoci'
.
- You can also specify a custom Sender ID – the name or number that will appear in the “From” label on the recipients phone. You can either add a “from” key to your .clickatell file or manually using the—from option:
{$} sms --from 'Luke Redpath' 447771234567 'Hello from clickatell'
For more information : http://clickatell.rubyforge.org/