Twitch is a project mainly written in Ruby, based on the MIT license.
A Twilio Client for Ruby
Set your credentials:
Twitch::SMS::Service.credentials(<AccountSID>,<AuthToken>)
Create (and send) an SMS Message:
@message = Twitch::SMS::Message.create("415-555-5555","415-666-6666","Hey, wanna grab dinner?")
@message.from # => "415-555-5555"
@message.to # => "415-666-6666"
@message.status # => "queued"
Retrieve a previously created message:
@message = Twitch::SMS::Message.find("SMeb4db1283b0c7077737c02aa01a35941")
@message.from # => "415-666-6666"
@message.to # => "415-555-5555"
@message.body # => "The judge said you can't text me anymore"
@message.status # => "sent"
Retrieve a paginated list of previously created messages:
@messages = Twitch::SMS::Message.paginate
@messages.current_page # => 1
@messages.total_pages # => 5
@messages.each do |m|
puts m.body
end
# => "Hey, wanna grab dinner?"
# => "The judge said you can't text me anymore."
Currently Twitch only supports Twilio's SMS service, but the intention is to create a full Twilio client.
Copyright (c) 2010 Marc Love. See LICENSE for details.