Permalink
Browse files

First version of splat (working)

Supported vendors:
+ Vmobo
+ BulkSMSPune

This code has been picked up from a private repository.
  • Loading branch information...
0 parents commit 1ea022a553c4907de186dc6166043e1aac43b740 @gautamrege gautamrege committed Aug 18, 2010
Showing with 1,718 additions and 0 deletions.
  1. +5 −0 .document
  2. +21 −0 .gitignore
  3. +20 −0 LICENSE
  4. +31 −0 README.rdoc
  5. +53 −0 Rakefile
  6. +1 −0 VERSION
  7. +32 −0 config/splat.yml
  8. +18 −0 config/vendors.yml
  9. BIN docs/2-waysms/2-WaySMS_com_manual.pdf
  10. BIN docs/Gupshup/GatewayAPIDoc.pdf
  11. +89 −0 docs/LSRC2010/demo/01_demo.md
  12. +70 −0 docs/LSRC2010/details/01_vendors.md
  13. +49 −0 docs/LSRC2010/details/02_splat.md
  14. BIN docs/LSRC2010/details/vendor1.png
  15. BIN docs/LSRC2010/details/vendor2.png
  16. +26 −0 docs/LSRC2010/future/01_next.md
  17. +62 −0 docs/LSRC2010/intro/01_new_slide.md
  18. BIN docs/LSRC2010/intro/rapidsms.jpg
  19. +46 −0 docs/LSRC2010/main.css
  20. +3 −0 docs/LSRC2010/public/css/main.css
  21. +8 −0 docs/LSRC2010/showoff.json
  22. BIN docs/Specification - v0.1.odt
  23. +397 −0 docs/Vmobo/partner_api_spec.html
  24. BIN docs/clickatell/Clickatell_HTTP.pdf
  25. +89 −0 lib/splat.rb
  26. +35 −0 lib/splat/configuration.rb
  27. +23 −0 lib/splat/error.rb
  28. +117 −0 lib/splat/gateway.rb
  29. +13 −0 lib/splat/initializer.rb
  30. +17 −0 lib/splat/insertion.rb
  31. +32 −0 lib/splat/request.rb
  32. +29 −0 lib/splat/response.rb
  33. +9 −0 lib/splat/utils.rb
  34. +14 −0 lib/splat/validator.rb
  35. +51 −0 lib/splat/vendors/bulksmspune/bulksmspune_gateway.rb
  36. +48 −0 lib/splat/vendors/clickatell/clickatell_gateway.rb
  37. +108 −0 lib/splat/vendors/vmobo/vmobo_gateway.rb
  38. +60 −0 lib/splat/vendors/vmobo/xml/schema.rb
  39. +32 −0 lib/splat/vendors/vmobo/xml/schema/vmobo.xsd
  40. +53 −0 splat.gemspec
  41. +40 −0 test.rb
  42. +10 −0 test/helper.rb
  43. +7 −0 test/test_splat.rb
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
@@ -0,0 +1,21 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Gautam Rege
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
+== SPlat - Sms PLATform ==
+
+SPlat is an integration platform to make use of SMS integration really
+easy. Using this platform has the following advantages:
+
+* Single point of integration
+* Change vendors without changing code.
+* Send and receive SMS.
+* Generic Exception Handling.
+* Standardized reports.
+* SMS tagged user groups.
+* SMS bogus gateway for testing.
+* Scheduling SMS for delivery.
+
+=== What SPlat isn't! ===
+SPlat is not an SMS gateway. You still need to buy a subscription from one
+of the vendors SPlat supports.
+
+== Note on Patches/Pull Requests
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests for it. This is important so I don't break it in a
+ future version unintentionally.
+* Commit, do not mess with rakefile, version, or history.
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
+* Send me a pull request. Bonus points for topic branches.
+
+== Copyright
+
+Copyright (c) 2010 Josh Software Pvt. Ltd. See LICENSE for details.
@@ -0,0 +1,53 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "splat"
+ gem.summary = %Q{TODO: one-line summary of your gem}
+ gem.description = %Q{TODO: longer description of your gem}
+ gem.email = "gautam@joshsoftware.com"
+ gem.homepage = "http://github.com/gautamrege/splat"
+ gem.authors = ["Gautam Rege"]
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "splat #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1 @@
+0.0.1
@@ -0,0 +1,32 @@
+
+# Mobile number formats varies from vendor to vendor.
+# To resolve this, SPlat splits country_code and mobile number.
+# The default format is: +<country code><single white space><mobile number.
+#
+# Its quite possible that you may require to use the before_send hook to
+# manipulate the number format.
+#
+# At your own risk, update the regex for default_number_format if you know
+# what you are doing.
+#default_number_format: '^\+\d{1,4}\ \d{8,12}$' # +91 9812345867
+
+
+# By default SPlat will try 5 times to send an SMS on failure.
+#retries: 5
+
+# Default insertion is a means to work-around incomplete string insertions.
+# This can be overridden using the options parameter.
+#use_default_insertion: true
+#default_insertion: ""
+
+
+default:
+ number_format: '^\+\d{1,4}\ \d{8,12}$' # +91 9812345867
+ retries: 5
+ use_default_insertion: true
+ default_insertion: ""
+
+bogus_gateway:
+ provider_url: "http//test.com"
+ username: test
+ password: test
@@ -0,0 +1,18 @@
+
+vmobo:
+ provider_url: 'http://www.vMobo.in/bulk_send/v1'
+ username:
+ api_key:
+ keyword:
+
+bulksmspune:
+ provider_url: "http://www.bulksmspune.mobi/sendurlcomma.asp"
+ username:
+ password:
+ senderid:
+
+clickatell:
+ api_key:
+ username:
+ password:
+
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,89 @@
+!SLIDE
+
+# Installing SPlat
+
+ $ gem install splat
+
+!SLIDE
+
+# Initializing the SMS gateways
+
+!SLIDE
+
+# Configuring SPlat
+
+!SLIDE bullets
+
+# Mobile number formats
+
+* +1 501-234-8473
+* 001 5012348473
+* +5012348473
+* 5012348473
+* All vendors have their own formats.
+
+!SLIDE
+
+# Splat default number format
+
+ @@@ruby
+ /^\+\d{1,4}\ \d{8,12}$/ # +91 9812345867
+
+
+!SLIDE bullets incremental
+
+# Splat callback
+
+* Application can register a callback.
+* :before_send
+* Manipulate the number to splat format.
+
+!SLIDE
+
+# Demo1 - Send a simple SMS
+
+ @@@ruby
+ require 'lib/splat'
+
+ number = '+91 9960054954'
+ gw1 = Splat::Base.new(:vmobo)
+
+ msg = "Fall SPlat on your face!"
+ p gw1.send_sms(msg, number)
+
+!SLIDE commandline incremental
+
+# Demo1 - the first run!
+
+ $ ruby test.rb
+ #<Splat::Response:0x1015530c8 @phone_numbers...
+
+!SLIDE
+
+# Demo2 - Using both SMS gateways together
+
+ @@@ruby
+
+ gw = {}
+ gw['bulksms'] = Splat::Base.new(:bulksmspune)
+ gw['vmobo'] = Splat::Base.new(:vmobo)
+
+ numbers = ['+91 9960054954', '+91 9881395656']
+ gw.each do |provider, obj|
+ obj.send_bulk_sms(msg, numbers)
+ end
+
+!SLIDE
+
+# Demo3 - Custom messages
+
+ @@@ruby
+ custom_msg = "Hi $1, hold on to your $2."
+ options = {
+ '+91 9960054954' => ['Jiren', 'shorts'],
+ '+91 9881395656' => ['Gautam' , 'stocks'],
+ '+91 9880397111' => ['Jane' , 'skirt']
+ }
+
+ gw.send_bulk_sms_with_insertion(custom_msg,
+ options)
@@ -0,0 +1,70 @@
+!SLIDE bullets incremental
+
+# Motivated?
+
+* So, SMS as MobileVAS is cool.
+* Just do it!
+
+!SLIDE bullets incremental
+
+# So how does one start ?
+
+* Choose a vendor!
+* (???)
+* Implement the API
+* (???)
+
+!SLIDE center
+
+# Vendor Analysis #
+
+![Feature Analysis](vendor1.png)
+
+!SLIDE center
+
+# Vendor Analysis #
+
+![Features Analysis](vendor2.png)
+
+!SLIDE bullets
+
+# So how does one start ?
+
+* Choose a vendor!
+* ( Clickatell, Twilio, Tropo, BulkSMS, vMobo, ...)
+* Implement the API
+* (HTTP, XML, REST, JSON, ... )
+
+!SLIDE center
+
+# All the best!
+
+!SLIDE bullets
+
+# Hmm.. Choices! Choices!
+
+* What the hell? Choose *anyone*
+* Resolve issues later!
+
+!SLIDE bullets incremental
+
+# But.. the nagging doubts linger!
+
+* Did I choose the right vendor?
+* Can I afford to change the vendor now?
+* Is there some standard for SMS API?
+* <span class="highlight">Argh! Its too late for them!</span>
+
+!SLIDE bullets incremental
+
+# The Solution?
+
+* Hire some unwitting developer!
+* Outsource to India? ;)
+
+!SLIDE center
+
+# Nirvana
+
+# "Never fear <span class='splat'>SPlat</span> is here"
+
@@ -0,0 +1,49 @@
+!SLIDE bullets
+
+# Why <span class="splat">SPlat</span>?
+
+* Some sort of standards in SMS API!
+* Single point of integration
+* Code Consistency
+
+
+!SLIDE bullets
+
+# What is <span class="splat">SPlat</span>?
+
+* A library with SMS APIs.
+* Automatically integrates with different vendors.
+* Packaged in a Ruby gem.
+* http://www.gemcutter.com/gems/splat
+* YML configuration.
+
+!SLIDE bullets incremental
+
+# Not very exciting ? Well..
+
+* Now you can change SMS gateway without affecting code
+* Better still..
+* <span class="highlight">Switch</span> between multiple SMS gateways
+* Even better..
+* Work with multiple SMS gateways simultaneously!
+
+!SLIDE bullets incremental
+
+# And the list continues..
+
+* Send customized messages in bulk.
+* Test via bogus SMS gateway for different vendors.
+* Schedule sending SMS.
+* Manage multiple tagged lists for sending bulk SMS
+* Standardized status and statistical reports
+
+!SLIDE bullets incremental
+
+# <span class='splat'>SPlat</span> does this all?
+
+* No! Not yet - we're getting there!
+* Splat is 3 months old.
+* Born out of necessity than ingenuity!
+* Being built of our free time
+* Open Source Ruby
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

1 comment on commit 1ea022a

hanishj commented on 1ea022a Feb 9, 2012

hi i just clone the code when i run it is showing the site under construction. when i change in routes i am unable to access the pages. can you help what should i do

Please sign in to comment.