Easily create scripts to monitor SMS activity on your 3G key and answer automatically
Go to file
Guillaume Dott 31932325f9 Add support for multiple backends 2017-04-13 10:31:16 +02:00
examples Add possibility to handle specific actions 2013-11-07 11:06:27 +01:00
lib Add support for multiple backends 2017-04-13 10:31:16 +02:00
.gitignore First commit 2013-10-01 15:24:47 +02:00
Gemfile First commit 2013-10-01 15:24:47 +02:00
LICENSE.txt First commit 2013-10-01 15:24:47 +02:00
README.md Send answers with Biju and remove machine definition from the gem 2013-10-01 15:24:47 +02:00
Rakefile First commit 2013-10-01 15:24:47 +02:00
smsd.gemspec Remove I18n dependency 2013-11-26 15:55:10 +01:00

README.md

SMSd

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'smsd'

And then execute:

$ bundle

Or install it yourself as:

$ gem install smsd

Usage

#!/usr/bin/env ruby

require 'smsd'
require 'net/http'

cli = SMSd::CLI.new(ARGV) do
  machine = SMSd::AnsweringMachine.new(I18n.t(:default_answer))

  machine.add_action(/hello/i, 'Hello !!')
  machine.add_action(/what/i) do |from, to, message|
    "The phone number #{from} sent '#{message}' to #{to}"
  end
  machine.add_action(/myip/i) do
    Net::HTTP.get('icanhazip.com', '/').chomp
  end
end

cli.run

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

SMSd is released under AGPLv3 license. Copyright (c) 2013 La Fourmi Immo