Entinfo
Rails gem for 创世漫道短信api
Installation
Add this line to your application's Gemfile:
gem 'entinfo'
And then execute:
$ bundle
Or install it yourself as:
$ gem install entinfo
Configuration
config/initializers/entinfo.rb
Entinfo.configure do |config|
# 运营商分配给您的SN号(帐号)
config.sn = 'SDK-XXX-000-00000'
# 运营商分配给您的密码
config.pwd = '0-0_0-0'
end
Usage
Send message
Entinfo.send_sms('15200000000','hello【短信签名】')
# {:success=>"221340284130873849"}
# or
# {:error=>"error_code"}
Receive message
Entinfo.receive_sms()
#=>[{:from=>"15200000000", :content=>"test", :time=>2016-01-18 10:41:47 +0800}]
Contributing
- Fork it ( https://github.com/[my-github-username]/entinfo/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request