Hi, I''m relatively new to rails so I''m sorry if this question seems ridiculous! I''m creating an application to send SMS messages, I got a gateway URL like: *http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx &Sid=xxx&fl=0&mt=0*<http://www.it2sy.com/html/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=971504858561&msg=Welcome%20to%20IT2SYtechnologies%20&Sid=IT-4U&fl=0&mt=0> I created a simple form that enables the user to enter the text of the short message, the sender name (or number), and the destination mobile number. A copy of the message should be stored in the database as the user sends it. I have created a Message model that has the required fields. I have the following scaffold-generated create method that creates a message and stores it in the database: ****<http://www.it2sy.com/html/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=971504858561&msg=Welcome%20to%20IT2SYtechnologies%20&Sid=IT-4U&fl=0&mt=0> ****************************************************** def create @message = Message.new(params[:message]) respond_to do |format| if @message.save flash[:notice] = ''Message was successfully created.'' format.html { redirect_to(@message) } format.xml { render :xml => @message, :status => :created, :location => @message } else format.html { render :action => "new" } format.xml { render :xml => @message.errors, :status => :unprocessable_entity } end end end ******************************************************* My question is: How can I transparently touch the gateway''s URL and pass the required arguments to it when the user submits the form? Your help is really appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2 Mar 2008, at 11:11, AN@S wrote:> Hi, > I''m relatively new to rails so I''m sorry if this question seems > ridiculous! > > I''m creating an application to send SMS messages, I got a gateway > URL like: > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > &Sid=xxx&fl=0&mt=0 > > I created a simple form that enables the user to enter the text of > the short message, the sender name (or number), and the destination > mobile number. A copy of the message should be stored in the > database as the user sends it. I have created a Message model that > has the required fields. > > > I have the following scaffold-generated create method that creates a > message and stores it in the database:You need to have a look at the Net::HTTP libraries, which allows you to make http requests of various sorts. If i were you, I''d add a send method to the Message model which does the necessary dtugg. Fred> > ****************************************************** > def create > @message = Message.new(params[:message]) > > respond_to do |format| > if @message.save > flash[:notice] = ''Message was successfully created.'' > format.html { redirect_to(@message) } > format.xml { render :xml => @message, :status > => :created, :location => @message } > else > format.html { render :action => "new" } > format.xml { render :xml => @message.errors, :status > => :unprocessable_entity } > end > end > end > > ******************************************************* > > My question is: How can I transparently touch the gateway''s URL and > pass the required arguments to it when the user submits the form? > > Your help is really appreciated. > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you Frederick, I''m looking into this library, but does it really require using a library to send a get request? Regards On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > Hi, > > I''m relatively new to rails so I''m sorry if this question seems > > ridiculous! > > > > I''m creating an application to send SMS messages, I got a gateway > > URL like: > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > &Sid=xxx&fl=0&mt=0 > > > > I created a simple form that enables the user to enter the text of > > the short message, the sender name (or number), and the destination > > mobile number. A copy of the message should be stored in the > > database as the user sends it. I have created a Message model that > > has the required fields. > > > > > > I have the following scaffold-generated create method that creates a > > message and stores it in the database: > > > You need to have a look at the Net::HTTP libraries, which allows you > to make http requests of various sorts. If i were you, I''d add a send > method to the Message model which does the necessary dtugg. > > Fred > > > > > ****************************************************** > > def create > > @message = Message.new(params[:message]) > > > > respond_to do |format| > > if @message.save > > flash[:notice] = ''Message was successfully created.'' > > format.html { redirect_to(@message) } > > format.xml { render :xml => @message, :status > > => :created, :location => @message } > > else > > format.html { render :action => "new" } > > format.xml { render :xml => @message.errors, :status > > => :unprocessable_entity } > > end > > end > > end > > > > ******************************************************* > > > > My question is: How can I transparently touch the gateway''s URL and > > pass the required arguments to it when the user submits the form? > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > >-- Anas Marrawi Visit me at: www.anasonline.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
not really if you are on linux you can send it by adding a `wget *http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx &Sid=xxx&fl=0&mt=0`<http://www.it2sy.com/html/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=971504858561&msg=Welcome%20to%20IT2SYtechnologies%20&Sid=IT-4U&fl=0&mt=0> * but this is hacky. On Mon, Mar 3, 2008 at 12:57 PM, AN@S <anas.marrawi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thank you Frederick, I''m looking into this library, but does it really > require using a library to send a get request? > > Regards > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > Hi, > > > I''m relatively new to rails so I''m sorry if this question seems > > > ridiculous! > > > > > > I''m creating an application to send SMS messages, I got a gateway > > > URL like: > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > &Sid=xxx&fl=0&mt=0 > > > > > > I created a simple form that enables the user to enter the text of > > > the short message, the sender name (or number), and the destination > > > mobile number. A copy of the message should be stored in the > > > database as the user sends it. I have created a Message model that > > > has the required fields. > > > > > > > > > I have the following scaffold-generated create method that creates a > > > message and stores it in the database: > > > > > > You need to have a look at the Net::HTTP libraries, which allows you > > to make http requests of various sorts. If i were you, I''d add a send > > method to the Message model which does the necessary dtugg. > > > > Fred > > > > > > > > ****************************************************** > > > def create > > > @message = Message.new(params[:message]) > > > > > > respond_to do |format| > > > if @message.save > > > flash[:notice] = ''Message was successfully created.'' > > > format.html { redirect_to(@message) } > > > format.xml { render :xml => @message, :status > > > => :created, :location => @message } > > > else > > > format.html { render :action => "new" } > > > format.xml { render :xml => @message.errors, :status > > > => :unprocessable_entity } > > > end > > > end > > > end > > > > > > ******************************************************* > > > > > > My question is: How can I transparently touch the gateway''s URL and > > > pass the required arguments to it when the user submits the form? > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > Anas Marrawi > Visit me at: www.anasonline.net > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Mar 2008, at 07:27, AN@S wrote:> Thank you Frederick, I''m looking into this library, but does it > really require using a library to send a get request? >Yes. But it''s part of the standard ruby library and you won''t get very far in general if you never use the ruby standard library. Fred> Regards > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > Hi, > > I''m relatively new to rails so I''m sorry if this question seems > > ridiculous! > > > > I''m creating an application to send SMS messages, I got a gateway > > URL like: > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > &Sid=xxx&fl=0&mt=0 > > > > I created a simple form that enables the user to enter the text of > > the short message, the sender name (or number), and the destination > > mobile number. A copy of the message should be stored in the > > database as the user sends it. I have created a Message model that > > has the required fields. > > > > > > I have the following scaffold-generated create method that creates a > > message and stores it in the database: > > > You need to have a look at the Net::HTTP libraries, which allows you > to make http requests of various sorts. If i were you, I''d add a send > method to the Message model which does the necessary dtugg. > > Fred > > > > > ****************************************************** > > def create > > @message = Message.new(params[:message]) > > > > respond_to do |format| > > if @message.save > > flash[:notice] = ''Message was successfully created.'' > > format.html { redirect_to(@message) } > > format.xml { render :xml => @message, :status > > => :created, :location => @message } > > else > > format.html { render :action => "new" } > > format.xml { render :xml => @message.errors, :status > > => :unprocessable_entity } > > end > > end > > end > > > > ******************************************************* > > > > My question is: How can I transparently touch the gateway''s URL and > > pass the required arguments to it when the user submits the form? > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > -- > Anas Marrawi > Visit me at: www.anasonline.net > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fred, did you make the SMS gateway? or Did you use an external service?.. Salu2... On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > Thank you Frederick, I''m looking into this library, but does it > > really require using a library to send a get request? > > > Yes. But it''s part of the standard ruby library and you won''t get very > far in general if you never use the ruby standard library. > > Fred > > Regards > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > Hi, > > > I''m relatively new to rails so I''m sorry if this question seems > > > ridiculous! > > > > > > I''m creating an application to send SMS messages, I got a gateway > > > URL like: > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > &Sid=xxx&fl=0&mt=0 > > > > > > I created a simple form that enables the user to enter the text of > > > the short message, the sender name (or number), and the destination > > > mobile number. A copy of the message should be stored in the > > > database as the user sends it. I have created a Message model that > > > has the required fields. > > > > > > > > > I have the following scaffold-generated create method that creates a > > > message and stores it in the database: > > > > > > You need to have a look at the Net::HTTP libraries, which allows you > > to make http requests of various sorts. If i were you, I''d add a send > > method to the Message model which does the necessary dtugg. > > > > Fred > > > > > > > > ****************************************************** > > > def create > > > @message = Message.new(params[:message]) > > > > > > respond_to do |format| > > > if @message.save > > > flash[:notice] = ''Message was successfully created.'' > > > format.html { redirect_to(@message) } > > > format.xml { render :xml => @message, :status > > > => :created, :location => @message } > > > else > > > format.html { render :action => "new" } > > > format.xml { render :xml => @message.errors, :status > > > => :unprocessable_entity } > > > end > > > end > > > end > > > > > > ******************************************************* > > > > > > My question is: How can I transparently touch the gateway''s URL and > > > pass the required arguments to it when the user submits the form? > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > Anas Marrawi > > Visit me at: www.anasonline.net > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Mar 2008, at 10:43, masch wrote:> Fred, did you make the SMS gateway? or Did you use an external > service?.. >We use an external service. Fred> Salu2... > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > wrote: > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > Thank you Frederick, I''m looking into this library, but does it > > really require using a library to send a get request? > > > Yes. But it''s part of the standard ruby library and you won''t get very > far in general if you never use the ruby standard library. > > Fred > > Regards > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > Hi, > > > I''m relatively new to rails so I''m sorry if this question seems > > > ridiculous! > > > > > > I''m creating an application to send SMS messages, I got a gateway > > > URL like: > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > &Sid=xxx&fl=0&mt=0 > > > > > > I created a simple form that enables the user to enter the text of > > > the short message, the sender name (or number), and the > destination > > > mobile number. A copy of the message should be stored in the > > > database as the user sends it. I have created a Message model that > > > has the required fields. > > > > > > > > > I have the following scaffold-generated create method that > creates a > > > message and stores it in the database: > > > > > > You need to have a look at the Net::HTTP libraries, which allows you > > to make http requests of various sorts. If i were you, I''d add a > send > > method to the Message model which does the necessary dtugg. > > > > Fred > > > > > > > > ****************************************************** > > > def create > > > @message = Message.new(params[:message]) > > > > > > respond_to do |format| > > > if @message.save > > > flash[:notice] = ''Message was successfully created.'' > > > format.html { redirect_to(@message) } > > > format.xml { render :xml => @message, :status > > > => :created, :location => @message } > > > else > > > format.html { render :action => "new" } > > > format.xml { render :xml => @message.errors, :status > > > => :unprocessable_entity } > > > end > > > end > > > end > > > > > > ******************************************************* > > > > > > My question is: How can I transparently touch the gateway''s URL > and > > > pass the required arguments to it when the user submits the form? > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > Anas Marrawi > > Visit me at: www.anasonline.net > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, I used the library, it is easier than what I expected,: *************************************************************************** class Message < ActiveRecord::Base def sendsms require "net/http" Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=Hi from rails&Sid=xxxx&fl=0&mt=0'') end end *************************************************************************** Now it works but is there any possibility that the URL could be exposed in a way or another to some bad user? Is there something like encrypting the URL or something? Or is it just safe to use the above method? On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 3 Mar 2008, at 10:43, masch wrote: > > > Fred, did you make the SMS gateway? or Did you use an external > > service?.. > > > > We use an external service. > > Fred > > > > Salu2... > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung < > frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > wrote: > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > Thank you Frederick, I''m looking into this library, but does it > > > really require using a library to send a get request? > > > > > Yes. But it''s part of the standard ruby library and you won''t get very > > far in general if you never use the ruby standard library. > > > > Fred > > > Regards > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > Hi, > > > > I''m relatively new to rails so I''m sorry if this question seems > > > > ridiculous! > > > > > > > > I''m creating an application to send SMS messages, I got a gateway > > > > URL like: > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > I created a simple form that enables the user to enter the text of > > > > the short message, the sender name (or number), and the > > destination > > > > mobile number. A copy of the message should be stored in the > > > > database as the user sends it. I have created a Message model that > > > > has the required fields. > > > > > > > > > > > > I have the following scaffold-generated create method that > > creates a > > > > message and stores it in the database: > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows you > > > to make http requests of various sorts. If i were you, I''d add a > > send > > > method to the Message model which does the necessary dtugg. > > > > > > Fred > > > > > > > > > > > ****************************************************** > > > > def create > > > > @message = Message.new(params[:message]) > > > > > > > > respond_to do |format| > > > > if @message.save > > > > flash[:notice] = ''Message was successfully created.'' > > > > format.html { redirect_to(@message) } > > > > format.xml { render :xml => @message, :status > > > > => :created, :location => @message } > > > > else > > > > format.html { render :action => "new" } > > > > format.xml { render :xml => @message.errors, :status > > > > => :unprocessable_entity } > > > > end > > > > end > > > > end > > > > > > > > ******************************************************* > > > > > > > > My question is: How can I transparently touch the gateway''s URL > > and > > > > pass the required arguments to it when the user submits the form? > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Anas Marrawi > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > >-- Anas Marrawi Visit me at: www.anasonline.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Mar 2008, at 16:39, AN@S wrote:> Hi, > > I used the library, it is easier than what I expected,: > > *************************************************************************** > > class Message < ActiveRecord::Base > def sendsms > require "net/http" > Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp? > username=xxxx&password=xxxx&mno=999999&msg=Hi from > rails&Sid=xxxx&fl=0&mt=0'') > end > > end > > *************************************************************************** > > Now it works but is there any possibility that the URL could be > exposed in a way or another to some bad user? Is there something > like encrypting the URL or something? Or is it just safe to use the > above method?It''s not impossible for someone in the right place at the right time to snoop that username and password. There''s not a lot you can do about that unless the people providing the service also provide https access (or use some other mitigating scheme, eg only allowing requests from certain ip addresses. Fred> > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 3 Mar 2008, at 10:43, masch wrote: > > > Fred, did you make the SMS gateway? or Did you use an external > > service?.. > > > > We use an external service. > > Fred > > > > Salu2... > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > wrote: > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > Thank you Frederick, I''m looking into this library, but does it > > > really require using a library to send a get request? > > > > > Yes. But it''s part of the standard ruby library and you won''t get > very > > far in general if you never use the ruby standard library. > > > > Fred > > > Regards > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > Hi, > > > > I''m relatively new to rails so I''m sorry if this question seems > > > > ridiculous! > > > > > > > > I''m creating an application to send SMS messages, I got a > gateway > > > > URL like: > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > I created a simple form that enables the user to enter the > text of > > > > the short message, the sender name (or number), and the > > destination > > > > mobile number. A copy of the message should be stored in the > > > > database as the user sends it. I have created a Message model > that > > > > has the required fields. > > > > > > > > > > > > I have the following scaffold-generated create method that > > creates a > > > > message and stores it in the database: > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows > you > > > to make http requests of various sorts. If i were you, I''d add a > > send > > > method to the Message model which does the necessary dtugg. > > > > > > Fred > > > > > > > > > > > ****************************************************** > > > > def create > > > > @message = Message.new(params[:message]) > > > > > > > > respond_to do |format| > > > > if @message.save > > > > flash[:notice] = ''Message was successfully created.'' > > > > format.html { redirect_to(@message) } > > > > format.xml { render :xml => @message, :status > > > > => :created, :location => @message } > > > > else > > > > format.html { render :action => "new" } > > > > format.xml { render :xml => @message.errors, :status > > > > => :unprocessable_entity } > > > > end > > > > end > > > > end > > > > > > > > ******************************************************* > > > > > > > > My question is: How can I transparently touch the gateway''s URL > > and > > > > pass the required arguments to it when the user submits the > form? > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Anas Marrawi > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, In case of sending Unicode messages I have to convert the message''s characters to hexadecimal, I''ve looked into Ruby documentation but it looks like Ruby doesn''t have enough regarding to this issue. I''ve been searching for hours but didn''t find a perfect solution ... do you have any suggestion guys? Thank you very much for your helpful suggestions. On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 3 Mar 2008, at 16:39, AN@S wrote: > > > Hi, > > > > > I used the library, it is easier than what I expected,: > > > > > *************************************************************************** > > > > class Message < ActiveRecord::Base > > def sendsms > > require "net/http" > > Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp? > > username=xxxx&password=xxxx&mno=999999&msg=Hi from > > rails&Sid=xxxx&fl=0&mt=0'') > > end > > > > end > > > > > *************************************************************************** > > > > Now it works but is there any possibility that the URL could be > > exposed in a way or another to some bad user? Is there something > > like encrypting the URL or something? Or is it just safe to use the > > above method? > > > It''s not impossible for someone in the right place at the right time > to snoop that username and password. There''s not a lot you can do > about that unless the people providing the service also provide https > access (or use some other mitigating scheme, eg only allowing requests > from certain ip addresses. > > Fred > > > > > > > > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 3 Mar 2008, at 10:43, masch wrote: > > > > > Fred, did you make the SMS gateway? or Did you use an external > > > service?.. > > > > > > > We use an external service. > > > > Fred > > > > > > > Salu2... > > > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung < > frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > wrote: > > > > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > > > Thank you Frederick, I''m looking into this library, but does it > > > > really require using a library to send a get request? > > > > > > > Yes. But it''s part of the standard ruby library and you won''t get > > very > > > far in general if you never use the ruby standard library. > > > > > > Fred > > > > Regards > > > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > > > Hi, > > > > > I''m relatively new to rails so I''m sorry if this question seems > > > > > ridiculous! > > > > > > > > > > I''m creating an application to send SMS messages, I got a > > gateway > > > > > URL like: > > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > > > I created a simple form that enables the user to enter the > > text of > > > > > the short message, the sender name (or number), and the > > > destination > > > > > mobile number. A copy of the message should be stored in the > > > > > database as the user sends it. I have created a Message model > > that > > > > > has the required fields. > > > > > > > > > > > > > > > I have the following scaffold-generated create method that > > > creates a > > > > > message and stores it in the database: > > > > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows > > you > > > > to make http requests of various sorts. If i were you, I''d add a > > > send > > > > method to the Message model which does the necessary dtugg. > > > > > > > > Fred > > > > > > > > > > > > > > ****************************************************** > > > > > def create > > > > > @message = Message.new(params[:message]) > > > > > > > > > > respond_to do |format| > > > > > if @message.save > > > > > flash[:notice] = ''Message was successfully created.'' > > > > > format.html { redirect_to(@message) } > > > > > format.xml { render :xml => @message, :status > > > > > => :created, :location => @message } > > > > > else > > > > > format.html { render :action => "new" } > > > > > format.xml { render :xml => @message.errors, :status > > > > > => :unprocessable_entity } > > > > > end > > > > > end > > > > > end > > > > > > > > > > ******************************************************* > > > > > > > > > > My question is: How can I transparently touch the gateway''s URL > > > and > > > > > pass the required arguments to it when the user submits the > > form? > > > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Anas Marrawi > > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >-- Anas Marrawi Visit me at: www.anasonline.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For the record, all carriers have an email SMS system. Sprint: [10-digit number]@messaging.sprintpcs.com Cingular / ATT : [number]@txt.att.com These services are of course free, and subject to limitations and possibly delays. If you need to send a ton of SMSes out, or need guarenteed quick delivery, you''ll need to look into an SMS gateway service like clickatell. Jason On Tue, Mar 4, 2008 at 9:30 AM, AN@S <anas.marrawi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > In case of sending Unicode messages I have to convert the message''s > characters to hexadecimal, I''ve looked into Ruby documentation but it looks > like Ruby doesn''t have enough regarding to this issue. I''ve been searching > for hours but didn''t find a perfect solution ... do you have any suggestion > guys? > > Thank you very much for your helpful suggestions. > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 3 Mar 2008, at 16:39, AN@S wrote: > > > > > Hi, > > > > > > > > I used the library, it is easier than what I expected,: > > > > > > > *************************************************************************** > > > > > > class Message < ActiveRecord::Base > > > def sendsms > > > require "net/http" > > > Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp? > > > username=xxxx&password=xxxx&mno=999999&msg=Hi from > > > rails&Sid=xxxx&fl=0&mt=0'') > > > end > > > > > > end > > > > > > > *************************************************************************** > > > > > > Now it works but is there any possibility that the URL could be > > > exposed in a way or another to some bad user? Is there something > > > like encrypting the URL or something? Or is it just safe to use the > > > above method? > > > > > > It''s not impossible for someone in the right place at the right time > > to snoop that username and password. There''s not a lot you can do > > about that unless the people providing the service also provide https > > access (or use some other mitigating scheme, eg only allowing requests > > from certain ip addresses. > > > > Fred > > > > > > > > > > > > > > > > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 3 Mar 2008, at 10:43, masch wrote: > > > > > > > Fred, did you make the SMS gateway? or Did you use an external > > > > service?.. > > > > > > > > > > We use an external service. > > > > > > Fred > > > > > > > > > > Salu2... > > > > > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > > wrote: > > > > > > > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > > > > > Thank you Frederick, I''m looking into this library, but does it > > > > > really require using a library to send a get request? > > > > > > > > > Yes. But it''s part of the standard ruby library and you won''t get > > > very > > > > far in general if you never use the ruby standard library. > > > > > > > > Fred > > > > > Regards > > > > > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > > > > > Hi, > > > > > > I''m relatively new to rails so I''m sorry if this question seems > > > > > > ridiculous! > > > > > > > > > > > > I''m creating an application to send SMS messages, I got a > > > gateway > > > > > > URL like: > > > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > > > > > I created a simple form that enables the user to enter the > > > text of > > > > > > the short message, the sender name (or number), and the > > > > destination > > > > > > mobile number. A copy of the message should be stored in the > > > > > > database as the user sends it. I have created a Message model > > > that > > > > > > has the required fields. > > > > > > > > > > > > > > > > > > I have the following scaffold-generated create method that > > > > creates a > > > > > > message and stores it in the database: > > > > > > > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows > > > you > > > > > to make http requests of various sorts. If i were you, I''d add a > > > > send > > > > > method to the Message model which does the necessary dtugg. > > > > > > > > > > Fred > > > > > > > > > > > > > > > > > ****************************************************** > > > > > > def create > > > > > > @message = Message.new(params[:message]) > > > > > > > > > > > > respond_to do |format| > > > > > > if @message.save > > > > > > flash[:notice] = ''Message was successfully created.'' > > > > > > format.html { redirect_to(@message) } > > > > > > format.xml { render :xml => @message, :status > > > > > > => :created, :location => @message } > > > > > > else > > > > > > format.html { render :action => "new" } > > > > > > format.xml { render :xml => @message.errors, :status > > > > > > => :unprocessable_entity } > > > > > > end > > > > > > end > > > > > > end > > > > > > > > > > > > ******************************************************* > > > > > > > > > > > > My question is: How can I transparently touch the gateway''s URL > > > > and > > > > > > pass the required arguments to it when the user submits the > > > form? > > > > > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Anas Marrawi > > > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Clickatell is easy enough to use but cost about .064 / message. You just need to post to a url uri_str = "http://api.clickatell.com/http/sendmsg?user=&password=&api_id=&to=&text=Test+from+textagog+-+testing+how+long+a+sms+takes" response = Net::HTTP.get_response(URI.parse(uri_str)) then check the response for Net::HTTPSuccess and look for the clickatell confirmation ID if response.body =~ /^ID:/ ----- Original Message ---- From: Jason Roelofs <jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sent: Tuesday, March 4, 2008 9:43:41 AM Subject: [Rails] Re: Sending SMS from rails For the record, all carriers have an email SMS system. Sprint: [10-digit number]@messaging.sprintpcs.com Cingular / ATT : [number]@txt.att.com These services are of course free, and subject to limitations and possibly delays. If you need to send a ton of SMSes out, or need guarenteed quick delivery, you''ll need to look into an SMS gateway service like clickatell. Jason On Tue, Mar 4, 2008 at 9:30 AM, AN@S <anas.marrawi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > In case of sending Unicode messages I have to convert the message''s > characters to hexadecimal, I''ve looked into Ruby documentation but it looks > like Ruby doesn''t have enough regarding to this issue. I''ve been searching > for hours but didn''t find a perfect solution ... do you have any suggestion > guys? > > Thank you very much for your helpful suggestions. > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 3 Mar 2008, at 16:39, AN@S wrote: > > > > > Hi, > > > > > > > > I used the library, it is easier than what I expected,: > > > > > > > *************************************************************************** > > > > > > class Message < ActiveRecord::Base > > > def sendsms > > > require "net/http" > > > Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp? > > > username=xxxx&password=xxxx&mno=999999&msg=Hi from > > > rails&Sid=xxxx&fl=0&mt=0'') > > > end > > > > > > end > > > > > > > *************************************************************************** > > > > > > Now it works but is there any possibility that the URL could be > > > exposed in a way or another to some bad user? Is there something > > > like encrypting the URL or something? Or is it just safe to use the > > > above method? > > > > > > It''s not impossible for someone in the right place at the right time > > to snoop that username and password. There''s not a lot you can do > > about that unless the people providing the service also provide https > > access (or use some other mitigating scheme, eg only allowing requests > > from certain ip addresses. > > > > Fred > > > > > > > > > > > > > > > > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 3 Mar 2008, at 10:43, masch wrote: > > > > > > > Fred, did you make the SMS gateway? or Did you use an external > > > > service?.. > > > > > > > > > > We use an external service. > > > > > > Fred > > > > > > > > > > Salu2... > > > > > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > > wrote: > > > > > > > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > > > > > Thank you Frederick, I''m looking into this library, but does it > > > > > really require using a library to send a get request? > > > > > > > > > Yes. But it''s part of the standard ruby library and you won''t get > > > very > > > > far in general if you never use the ruby standard library. > > > > > > > > Fred > > > > > Regards > > > > > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > > > > > Hi, > > > > > > I''m relatively new to rails so I''m sorry if this question seems > > > > > > ridiculous! > > > > > > > > > > > > I''m creating an application to send SMS messages, I got a > > > gateway > > > > > > URL like: > > > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > > > > > I created a simple form that enables the user to enter the > > > text of > > > > > > the short message, the sender name (or number), and the > > > > destination > > > > > > mobile number. A copy of the message should be stored in the > > > > > > database as the user sends it. I have created a Message model > > > that > > > > > > has the required fields. > > > > > > > > > > > > > > > > > > I have the following scaffold-generated create method that > > > > creates a > > > > > > message and stores it in the database: > > > > > > > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows > > > you > > > > > to make http requests of various sorts. If i were you, I''d add a > > > > send > > > > > method to the Message model which does the necessary dtugg. > > > > > > > > > > Fred > > > > > > > > > > > > > > > > > ****************************************************** > > > > > > def create > > > > > > @message = Message.new(params[:message]) > > > > > > > > > > > > respond_to do |format| > > > > > > if @message.save > > > > > > flash[:notice] = ''Message was successfully created.'' > > > > > > format.html { redirect_to(@message) } > > > > > > format.xml { render :xml => @message, :status > > > > > > => :created, :location => @message } > > > > > > else > > > > > > format.html { render :action => "new" } > > > > > > format.xml { render :xml => @message.errors, :status > > > > > > => :unprocessable_entity } > > > > > > end > > > > > > end > > > > > > end > > > > > > > > > > > > ******************************************************* > > > > > > > > > > > > My question is: How can I transparently touch the gateway''s URL > > > > and > > > > > > pass the required arguments to it when the user submits the > > > form? > > > > > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Anas Marrawi > > > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you all, I''m already using a gateway and everything in fine in terms of sending messages from my app, my last question was just about the Unicode issue. Thanks On 04/03/2008, Mark Studebaker <mark-h9LRGznmPqMAvxtiuMwx3w@public.gmane.org> wrote:> > Clickatell is easy enough to use but cost about .064 / message. > > > > You just need to post to a url > > uri_str = " > http://api.clickatell.com/http/sendmsg?user=&password=&api_id=&to=&text=Test+from+textagog+-+testing+how+long+a+sms+takes > " > > response = Net::HTTP.get_response(URI.parse(uri_str)) > > > > then check the response for Net::HTTPSuccess and look for the clickatell > confirmation ID > > > > if response.body =~ /^ID:/ > > > ----- Original Message ---- > From: Jason Roelofs <jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Sent: Tuesday, March 4, 2008 9:43:41 AM > Subject: [Rails] Re: Sending SMS from rails > > > For the record, all carriers have an email SMS system. > > Sprint: [10-digit number]@messaging.sprintpcs.com > Cingular / ATT : [number]@txt.att.com > > These services are of course free, and subject to limitations and > possibly delays. If you need to send a ton of SMSes out, or need > guarenteed quick delivery, you''ll need to look into an SMS gateway > service like clickatell. > > Jason > > On Tue, Mar 4, 2008 at 9:30 AM, AN@S <anas.marrawi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > In case of sending Unicode messages I have to convert the message''s > > characters to hexadecimal, I''ve looked into Ruby documentation but it > looks > > like Ruby doesn''t have enough regarding to this issue. I''ve been > searching > > for hours but didn''t find a perfect solution ... do you have any > suggestion > > guys? > > > > Thank you very much for your helpful suggestions. > > > > > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > On 3 Mar 2008, at 16:39, AN@S wrote: > > > > > > > Hi, > > > > > > > > > > > I used the library, it is easier than what I expected,: > > > > > > > > > > > *************************************************************************** > > > > > > > > class Message < ActiveRecord::Base > > > > def sendsms > > > > require "net/http" > > > > Net::HTTP.get_response(''www.domain.com'',''/sendsms/sendsms.asp? > > > > username=xxxx&password=xxxx&mno=999999&msg=Hi from > > > > rails&Sid=xxxx&fl=0&mt=0'') > > > > end > > > > > > > > end > > > > > > > > > > > *************************************************************************** > > > > > > > > Now it works but is there any possibility that the URL could be > > > > exposed in a way or another to some bad user? Is there something > > > > like encrypting the URL or something? Or is it just safe to use the > > > > above method? > > > > > > > > > It''s not impossible for someone in the right place at the right time > > > to snoop that username and password. There''s not a lot you can do > > > about that unless the people providing the service also provide https > > > access (or use some other mitigating scheme, eg only allowing requests > > > from certain ip addresses. > > > > > > Fred > > > > > > > > > > > > > > > > > > > > > > > > > > > On 03/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > On 3 Mar 2008, at 10:43, masch wrote: > > > > > > > > > Fred, did you make the SMS gateway? or Did you use an external > > > > > service?.. > > > > > > > > > > > > > We use an external service. > > > > > > > > Fred > > > > > > > > > > > > > Salu2... > > > > > > > > > > On Mon, Mar 3, 2008 at 4:39 AM, Frederick Cheung > > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > > > wrote: > > > > > > > > > > > > > > > On 3 Mar 2008, at 07:27, AN@S wrote: > > > > > > > > > > > Thank you Frederick, I''m looking into this library, but does it > > > > > > really require using a library to send a get request? > > > > > > > > > > > Yes. But it''s part of the standard ruby library and you won''t get > > > > very > > > > > far in general if you never use the ruby standard library. > > > > > > > > > > Fred > > > > > > Regards > > > > > > > > > > > > On 02/03/2008, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > > > > > > > > > > > > On 2 Mar 2008, at 11:11, AN@S wrote: > > > > > > > > > > > > > Hi, > > > > > > > I''m relatively new to rails so I''m sorry if this question > seems > > > > > > > ridiculous! > > > > > > > > > > > > > > I''m creating an application to send SMS messages, I got a > > > > gateway > > > > > > > URL like: > > > > > > > > > > http://www.domain.com/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=xxx > > > > > > > &Sid=xxx&fl=0&mt=0 > > > > > > > > > > > > > > I created a simple form that enables the user to enter the > > > > text of > > > > > > > the short message, the sender name (or number), and the > > > > > destination > > > > > > > mobile number. A copy of the message should be stored in the > > > > > > > database as the user sends it. I have created a Message model > > > > that > > > > > > > has the required fields. > > > > > > > > > > > > > > > > > > > > > I have the following scaffold-generated create method that > > > > > creates a > > > > > > > message and stores it in the database: > > > > > > > > > > > > > > > > > > You need to have a look at the Net::HTTP libraries, which allows > > > > you > > > > > > to make http requests of various sorts. If i were you, I''d add a > > > > > send > > > > > > method to the Message model which does the necessary dtugg. > > > > > > > > > > > > Fred > > > > > > > > > > > > > > > > > > > > ****************************************************** > > > > > > > def create > > > > > > > @message = Message.new(params[:message]) > > > > > > > > > > > > > > respond_to do |format| > > > > > > > if @message.save > > > > > > > flash[:notice] = ''Message was successfully created.'' > > > > > > > format.html { redirect_to(@message) } > > > > > > > format.xml { render :xml => @message, :status > > > > > > > => :created, :location => @message } > > > > > > > else > > > > > > > format.html { render :action => "new" } > > > > > > > format.xml { render :xml => @message.errors, :status > > > > > > > => :unprocessable_entity } > > > > > > > end > > > > > > > end > > > > > > > end > > > > > > > > > > > > > > ******************************************************* > > > > > > > > > > > > > > My question is: How can I transparently touch the gateway''s > URL > > > > > and > > > > > > > pass the required arguments to it when the user submits the > > > > form? > > > > > > > > > > > > > > Your help is really appreciated. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Anas Marrawi > > > > > > Visit me at: www.anasonline.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >-- Anas Marrawi Visit me at: www.anasonline.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, 2008-03-04 at 09:43 -0500, Jason Roelofs wrote:> For the record, all carriers have an email SMS system. > > Sprint: [10-digit number]@messaging.sprintpcs.com > Cingular / ATT : [number]@txt.att.com > > These services are of course free, and subject to limitations and > possibly delays. If you need to send a ton of SMSes out, or need > guarenteed quick delivery, you''ll need to look into an SMS gateway > service like clickatell. >---- add to that verizon... [number]@vtext.com Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---