Hi, I have a link and am getting the csv file when i do in the terminal. I would like to do that in rails controller. I need the authentication also. Here is the link " wget --user=test --password=test https://demo.service-now.com/incident_list.do\?CSV" Please help me. I was struck with this issue. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Guys some body please help me in this. On Oct 13, 2:14 pm, merbivore <eshward...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have a link and am getting the csv file when i do in the > terminal. I would like to do that in rails controller. I need the > authentication also. > > Here is the link > > " wget --user=test --password=testhttps://demo.service-now.com/incident_list.do\?CSV" > > Please help me. I was struck with this issue.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 13 October 2011 11:16, merbivore <eshwardeep-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Guys some body please help me in this.It is important to remember that one cannot necessarily expect a rapid reply from a mailing list. At any time about one third of the population of the world is asleep and another third is working. Of the remaining third the vast majority know nothing of RoR or have better things to do than monitor the list. Unfortunately that appears to leave just you and me and I don''t know the answer, other than to suggest using system() or backticks which is probably not the best way. It is best to wait 24 hours before bumping a question. Have you considered the fact that if you do this in the controller then the user will not get a response from his action until the get has completed and you do the next render? Colin> > On Oct 13, 2:14 pm, merbivore <eshward...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi, >> >> I have a link and am getting the csv file when i do in the >> terminal. I would like to do that in rails controller. I need the >> authentication also. >> >> Here is the link >> >> " wget --user=test --password=testhttps://demo.service-now.com/incident_list.do\?CSV" >> >> Please help me. I was struck with this issue. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
try exec i think On Oct 13, 6:16 pm, merbivore <eshward...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Guys some body please help me in this. > > On Oct 13, 2:14 pm, merbivore <eshward...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi, > > > I have a link and am getting the csv file when i do in the > > terminal. I would like to do that in rails controller. I need the > > authentication also. > > > Here is the link > > > " wget --user=test --password=testhttps://demo.service-now.com/incident_list.do\?CSV" > > > Please help me. I was struck with this issue.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Oct 13, 2011 at 05:14, merbivore <eshwardeep-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a link and am getting the csv file when i do in the terminal....> " wget --user=test --password=test https://demo.service-now.com/incident_list.do\?CSV"If I grok in fullness, what you are asking is essentially "how do I open a file by URL, in Ruby?" Googling "ruby open url" (sans quotes) yields some promising hits. Summary: check out net::http, and open-uri. I didn''t read it in enough detail to see how it handles authentication (if at all), but at least it''s a starting point. Maybe Googling "ruby open authenticated url" might be useful? I''ll leave that as an exercise for the reader. ;-) -Dave -- LOOKING FOR WORK, preferably Ruby on Rails, in NoVa/DC; see main web site. Main Web Site: davearonson.com Programming Blog: codosaur.us Excellence Blog: dare2xl.com -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You can just execute any bash command by including command within `` in your controller. For example in your case ''wget --user=test --password=test https://demo.service-now.com/incident_list.do\?CSV'' Regards; Kshitiz On Oct 13, 2:14 pm, merbivore <eshward...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have a link and am getting the csv file when i do in the > terminal. I would like to do that in rails controller. I need the > authentication also. > > Here is the link > > " wget --user=test --password=testhttps://demo.service-now.com/incident_list.do\?CSV" > > Please help me. I was struck with this issue.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.