I want a web application and a phone to be able to send messages to one another, and for the phone to receive the messages as text messages via SMS. What would be the easiest way to do this? I prefer for any examples to be in Ruby/RoR.
我希望网络应用程序和手机能够相互发送消息,并且手机可以通过短信接收短信作为短信。最简单的方法是什么?我更喜欢Ruby / RoR中的任何示例。
5 个解决方案
#1
2
The most developer friendly way to send SMS is throught http://www.twilio.com/
开发人员最友好的发送短信方式是通过http://www.twilio.com/
#2
1
I used www.clickatell.com , they have api and a ruby gem for accessing their api. More info about the gem can be found here: http://clickatell.rubyforge.org/
我使用www.clickatell.com,他们有api和ruby gem来访问他们的api。有关宝石的更多信息,请访问:http://clickatell.rubyforge.org/
#3
0
If you deploy on heroku, you aldo have moonshadow as an add-on. I recommend you to check different sms gateways tho, because the pricing varies A LOT
如果你在heroku上部署,你可以使用moonshadow作为附加组件。我建议你检查不同的短信网关,因为价格变化很多
#5
0
Buy credits from a sms gateway provider.
从短信网关提供商处购买积分。
Add require 'net/http' in your environments file if you are working on rails 3.x (not required for rails 2 apps).
如果您正在使用rails 3.x(rails 2应用程序不需要),请在您的环境文件中添加require'net / http'。
def send_welcome_sms
url=URI.parse("http://webaddress.com");
request = Net::HTTP::Post.new(url.path)
message = "message goes here"
request.set_form_data({'username'=>"abc", 'password'=>"xyz", 'to'=> "some number", 'text'=> "#{message}", 'from'=> "someone"})
response = Net::HTTP.new(url.host, url.port).start {|http| http.request(request) }
# If U are Behind The Proxy Comment Above Line And Uncomment Below Line, Give The Proxy Ip & Port
#response = Net::HTTP::Proxy("PROXY IP", PROXYPORT).new(url.host, url.port).start {|http| http.request(request) }
case response
when Net::HTTPSuccess
puts response.body
else
response.body
response.error!
end
end
#1
2
The most developer friendly way to send SMS is throught http://www.twilio.com/
开发人员最友好的发送短信方式是通过http://www.twilio.com/
#2
1
I used www.clickatell.com , they have api and a ruby gem for accessing their api. More info about the gem can be found here: http://clickatell.rubyforge.org/
我使用www.clickatell.com,他们有api和ruby gem来访问他们的api。有关宝石的更多信息,请访问:http://clickatell.rubyforge.org/
#3
0
If you deploy on heroku, you aldo have moonshadow as an add-on. I recommend you to check different sms gateways tho, because the pricing varies A LOT
如果你在heroku上部署,你可以使用moonshadow作为附加组件。我建议你检查不同的短信网关,因为价格变化很多
#4
#5
0
Buy credits from a sms gateway provider.
从短信网关提供商处购买积分。
Add require 'net/http' in your environments file if you are working on rails 3.x (not required for rails 2 apps).
如果您正在使用rails 3.x(rails 2应用程序不需要),请在您的环境文件中添加require'net / http'。
def send_welcome_sms
url=URI.parse("http://webaddress.com");
request = Net::HTTP::Post.new(url.path)
message = "message goes here"
request.set_form_data({'username'=>"abc", 'password'=>"xyz", 'to'=> "some number", 'text'=> "#{message}", 'from'=> "someone"})
response = Net::HTTP.new(url.host, url.port).start {|http| http.request(request) }
# If U are Behind The Proxy Comment Above Line And Uncomment Below Line, Give The Proxy Ip & Port
#response = Net::HTTP::Proxy("PROXY IP", PROXYPORT).new(url.host, url.port).start {|http| http.request(request) }
case response
when Net::HTTPSuccess
puts response.body
else
response.body
response.error!
end
end