[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

open - uri question

akanksha.baid

7/26/2006 4:36:00 PM

I am using open-uri for the first time. I need to visit a bunch of urls
and gather some data. Here is a samll code snippet

require 'open-uri' # allows the use of a file like API for URLs
open( "http://no-way-outspaik375.spaces.msn....) { |file|
lines = file.read
puts lines

}

and here is the error I get
ruby test.rb
/usr/local/lib/ruby/1.8/open-uri.rb:290:in `open_http': 500 Internal
Server Error (OpenURI::HTTPError)
from /usr/local/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'
from /usr/local/lib/ruby/1.8/open-uri.rb:167:in `open_loop'
from /usr/local/lib/ruby/1.8/open-uri.rb:165:in `open_loop'
from /usr/local/lib/ruby/1.8/open-uri.rb:135:in `open_uri'
from /usr/local/lib/ruby/1.8/open-uri.rb:531:in `open'
from /usr/local/lib/ruby/1.8/open-uri.rb:86:in `open'
from test.rb:2

However
require 'open-uri' # allows the use of a file like API for URLs
open( "http://www.google....) { |file|
lines = file.read
puts lines

}

works just fine. What am I doing wrong??

17 Answers

Chris Hulan

7/26/2006 4:43:00 PM

0


akanksha wrote:
> I am using open-uri for the first time. I need to visit a bunch of urls
> and gather some data. Here is a samll code snippet
>
> require 'open-uri' # allows the use of a file like API for URLs
> open( "http://no-way-outspaik375.spaces.msn....) { |file|
> lines = file.read
> puts lines
>
> }
>
> and here is the error I get
> ruby test.rb
> /usr/local/lib/ruby/1.8/open-uri.rb:290:in `open_http': 500 Internal
> Server Error (OpenURI::HTTPError)
....

You can see some info on HTTP 500 errors here:
http://www.checkupdown.com/status...

Maybe the service was down?
Or they may have it restricted to prevent scraping?
You may need to provide some info to fool the site into
thinking your a regular browser...

Cheers

akanksha.baid

7/26/2006 5:47:00 PM

0

> Maybe the service was down?

The service was not down. Both urls open in a browser.



> Or they may have it restricted to prevent scraping?
> You may need to provide some info to fool the site into
> thinking your a regular browser...

How would I go about doing that ...could you plz point me to some
info?
Thank you.

Ara.T.Howard

7/26/2006 5:56:00 PM

0

akanksha.baid

7/26/2006 6:19:00 PM

0

yes that works and so does mechanize ....thanks!!!



ara.t.howard@noaa.gov wrote:
> On Thu, 27 Jul 2006, akanksha wrote:
>
> >> Maybe the service was down?
> >
> > The service was not down. Both urls open in a browser.
> >
> >
> >
> >> Or they may have it restricted to prevent scraping?
> >> You may need to provide some info to fool the site into
> >> thinking your a regular browser...
> >
> > How would I go about doing that ...could you plz point me to some
> > info?
> > Thank you.
>
>
> you need to set user-agent to a 'real' browser. something like 'Mozilla/4.0'
>
> -a
> --
> suffering increases your inner strength. also, the wishing for suffering
> makes the suffering disappear.
> - h.h. the 14th dali lama

Marcus

11/20/2011 9:56:00 AM

0

On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
> On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
>
>
>
>
>
>
>
>
> > AdamUK schrieb:
>
> > > Hello Enthusiasts,
>
> > > I am currently doing an Architecture project where I will be designing a
> > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > Within this I think I would like to have :
> > > A greenhouse,
> > > A botany Laboratory
> > > Access to the tree nursery
> > > An Information Desk
> > > As well as other mainstays such as bedrooms, dining etc.
> > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > what enthusiasts/professionals would require or like in a building like
> > > this, so if you would be so kind could you help me out?
> > > Please reply with anything you would want or need in your dream venue
> > > for learning, viewing and volunteering in plant research within my
> > > building.
>
> > > All your opinions or suggestions would be really appreciated
>
> > > Thanks in Advance
>
> > > Adam
>
> > > P.S the project is for University, so budget is infinate :)
>
> > i would like a special place for various lemon parties.
>
> Is anybody going to believe anything posted by the crazy old pussy and
> asshole farrel after seeing her lie about a mole being  a wart? Now
> let the lying stupid whining cowardly vile HUNK of shit and convicted
> child molester go finger herself, again. Ernie

Asshole ernie shows us once again what an idiot she is.

As I have been saying, Farrel has not posted here in about 7 years
now.

ernie `thinks` ( I use the term lightly) that the real Farrel is still
here, and using of all names, "Hunky Farrel"?

Could asshole ernie possibly be any more stupid?

Marcus

P.S. prepare for auto-babble reply from asshole ernie

Ernie

11/20/2011 5:26:00 PM

0

On Nov 20, 4:55 am, Marcus <marcus_cox2...@yahoo.com> wrote:
> On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
> > > AdamUK schrieb:
>
> > > > Hello Enthusiasts,
>
> > > > I am currently doing an Architecture project where I will be designing a
> > > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > > Within this I think I would like to have :
> > > > A greenhouse,
> > > > A botany Laboratory
> > > > Access to the tree nursery
> > > > An Information Desk
> > > > As well as other mainstays such as bedrooms, dining etc.
> > > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > > what enthusiasts/professionals would require or like in a building like
> > > > this, so if you would be so kind could you help me out?
> > > > Please reply with anything you would want or need in your dream venue
> > > > for learning, viewing and volunteering in plant research within my
> > > > building.
>
> > > > All your opinions or suggestions would be really appreciated
>
> > > > Thanks in Advance
>
> > > > Adam
>
> > > > P.S the project is for University, so budget is infinate :)
>
> > > i would like a special place for various lemon parties.
>
> > Is anybody going to believe anything posted by the crazy old pussy and
> > asshole farrel after seeing her lie about a mole being  a wart? Now
> > let the lying stupid whining cowardly vile HUNK of shit and convicted
> > child molester go finger herself, again. Ernie
>
> Asshole ernie shows us once again what an idiot she is.
>
> As I have been saying, Farrel has not posted here in about 7 years
> now.
>
> ernie `thinks` ( I use the term lightly) that the real Farrel is still
> here, and using of all names,  "Hunky Farrel"?
>
> Could asshole ernie possibly be any more stupid?
>
> Marcus
>
> P.S. prepare for auto-babble reply from asshole ernie

Is anybody going to believe anything posted by the crazy old pussy and
asshole farrel after seeing her lie about a mole being a wart? Now let
the lying stupid whining cowardly vile HUNK of shit and convicted
child molester go finger herself, again. Ernie

Marcus

11/20/2011 5:29:00 PM

0

On Nov 20, 9:26 am, Ernie <eprimea...@gmail.com> wrote:
> On Nov 20, 4:55 am, Marcus <marcus_cox2...@yahoo.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
>
> > > On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
> > > > AdamUK schrieb:
>
> > > > > Hello Enthusiasts,
>
> > > > > I am currently doing an Architecture project where I will be designing a
> > > > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > > > Within this I think I would like to have :
> > > > > A greenhouse,
> > > > > A botany Laboratory
> > > > > Access to the tree nursery
> > > > > An Information Desk
> > > > > As well as other mainstays such as bedrooms, dining etc.
> > > > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > > > what enthusiasts/professionals would require or like in a building like
> > > > > this, so if you would be so kind could you help me out?
> > > > > Please reply with anything you would want or need in your dream venue
> > > > > for learning, viewing and volunteering in plant research within my
> > > > > building.
>
> > > > > All your opinions or suggestions would be really appreciated
>
> > > > > Thanks in Advance
>
> > > > > Adam
>
> > > > > P.S the project is for University, so budget is infinate :)
>
> > > > i would like a special place for various lemon parties.
>
> > > Is anybody going to believe anything posted by the crazy old pussy and
> > > asshole farrel after seeing her lie about a mole being  a wart? Now
> > > let the lying stupid whining cowardly vile HUNK of shit and convicted
> > > child molester go finger herself, again. Ernie
>
> > Asshole ernie shows us once again what an idiot she is.
>
> > As I have been saying, Farrel has not posted here in about 7 years
> > now.
>
> > ernie `thinks` ( I use the term lightly) that the real Farrel is still
> > here, and using of all names,  "Hunky Farrel"?
>
> > Could asshole ernie possibly be any more stupid?
>
> > Marcus
>
> > P.S. prepare for auto-babble reply from asshole ernie
>
> Is anybody going to believe anything posted by the crazy old pussy and
> asshole farrel after seeing her lie about a mole being a wart? Now let
> the lying stupid whining cowardly vile HUNK of shit and convicted
> child molester go finger herself, again. Ernie

And as predicted, auto-babble from asshole ernie.

Nobody cares what the growth was that was removed from your ugly face.

Marcus

Ernie

11/20/2011 9:07:00 PM

0

On Nov 20, 12:28 pm, Marcus <marcus_cox2...@yahoo.com> wrote:
> On Nov 20, 9:26 am, Ernie <eprimea...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 20, 4:55 am, Marcus <marcus_cox2...@yahoo.com> wrote:
>
> > > On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
>
> > > > On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
> > > > > AdamUK schrieb:
>
> > > > > > Hello Enthusiasts,
>
> > > > > > I am currently doing an Architecture project where I will be designing a
> > > > > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > > > > Within this I think I would like to have :
> > > > > > A greenhouse,
> > > > > > A botany Laboratory
> > > > > > Access to the tree nursery
> > > > > > An Information Desk
> > > > > > As well as other mainstays such as bedrooms, dining etc.
> > > > > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > > > > what enthusiasts/professionals would require or like in a building like
> > > > > > this, so if you would be so kind could you help me out?
> > > > > > Please reply with anything you would want or need in your dream venue
> > > > > > for learning, viewing and volunteering in plant research within my
> > > > > > building.
>
> > > > > > All your opinions or suggestions would be really appreciated
>
> > > > > > Thanks in Advance
>
> > > > > > Adam
>
> > > > > > P.S the project is for University, so budget is infinate :)
>
> > > > > i would like a special place for various lemon parties.
>
> > > > Is anybody going to believe anything posted by the crazy old pussy and
> > > > asshole farrel after seeing her lie about a mole being  a wart? Now
> > > > let the lying stupid whining cowardly vile HUNK of shit and convicted
> > > > child molester go finger herself, again. Ernie
>
> > > Asshole ernie shows us once again what an idiot she is.
>
> > > As I have been saying, Farrel has not posted here in about 7 years
> > > now.
>
> > > ernie `thinks` ( I use the term lightly) that the real Farrel is still
> > > here, and using of all names,  "Hunky Farrel"?
>
> > > Could asshole ernie possibly be any more stupid?
>
> > > Marcus
>
> > > P.S. prepare for auto-babble reply from asshole ernie
>
> > Is anybody going to believe anything posted by the crazy old pussy and
> > asshole farrel after seeing her lie about a mole being a wart? Now let
> > the lying stupid whining cowardly vile HUNK of shit and convicted
> > child molester go finger herself, again. Ernie
>
> And as predicted, auto-babble from asshole ernie.
>
> Nobody cares what the growth was that was removed from your ugly face.
>
> Marcus

Is anybody going to believe anything posted by the crazy old pussy and
asshole farrel after seeing her lie about a mole being a wart? ow let
the lying stupid whining cowardly vile HUNK of shit and convicted
child molester go finger herself, again. Ernie

Marcus

11/21/2011 2:31:00 AM

0

On Nov 20, 1:06 pm, Ernie <eprimea...@gmail.com> wrote:
> On Nov 20, 12:28 pm, Marcus <marcus_cox2...@yahoo.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 20, 9:26 am, Ernie <eprimea...@gmail.com> wrote:
>
> > > On Nov 20, 4:55 am, Marcus <marcus_cox2...@yahoo.com> wrote:
>
> > > > On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
>
> > > > > On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
> > > > > > AdamUK schrieb:
>
> > > > > > > Hello Enthusiasts,
>
> > > > > > > I am currently doing an Architecture project where I will be designing a
> > > > > > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > > > > > Within this I think I would like to have :
> > > > > > > A greenhouse,
> > > > > > > A botany Laboratory
> > > > > > > Access to the tree nursery
> > > > > > > An Information Desk
> > > > > > > As well as other mainstays such as bedrooms, dining etc.
> > > > > > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > > > > > what enthusiasts/professionals would require or like in a building like
> > > > > > > this, so if you would be so kind could you help me out?
> > > > > > > Please reply with anything you would want or need in your dream venue
> > > > > > > for learning, viewing and volunteering in plant research within my
> > > > > > > building.
>
> > > > > > > All your opinions or suggestions would be really appreciated
>
> > > > > > > Thanks in Advance
>
> > > > > > > Adam
>
> > > > > > > P.S the project is for University, so budget is infinate :)
>
> > > > > > i would like a special place for various lemon parties.
>
> > > > > Is anybody going to believe anything posted by the crazy old pussy and
> > > > > asshole farrel after seeing her lie about a mole being  a wart? Now
> > > > > let the lying stupid whining cowardly vile HUNK of shit and convicted
> > > > > child molester go finger herself, again. Ernie
>
> > > > Asshole ernie shows us once again what an idiot she is.
>
> > > > As I have been saying, Farrel has not posted here in about 7 years
> > > > now.
>
> > > > ernie `thinks` ( I use the term lightly) that the real Farrel is still
> > > > here, and using of all names,  "Hunky Farrel"?
>
> > > > Could asshole ernie possibly be any more stupid?
>
> > > > Marcus
>
> > > > P.S. prepare for auto-babble reply from asshole ernie
>
> > > Is anybody going to believe anything posted by the crazy old pussy and
> > > asshole farrel after seeing her lie about a mole being a wart? Now let
> > > the lying stupid whining cowardly vile HUNK of shit and convicted
> > > child molester go finger herself, again. Ernie
>
> > And as predicted, auto-babble from asshole ernie.
>
> > Nobody cares what the growth was that was removed from your ugly face.
>
> > Marcus
>
> Is anybody going to believe anything posted by the crazy old pussy and
> asshole farrel after seeing her lie about a mole being a wart? ow let
> the lying stupid whining cowardly vile HUNK of shit and convicted
> child molester go finger herself, again. Ernie

What is an ow let?

Marcus

Ernie

11/21/2011 3:52:00 AM

0

On Nov 20, 9:31 pm, Marcus <marcus_cox2...@yahoo.com> wrote:
> On Nov 20, 1:06 pm, Ernie <eprimea...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 20, 12:28 pm, Marcus <marcus_cox2...@yahoo.com> wrote:
>
> > > On Nov 20, 9:26 am, Ernie <eprimea...@gmail.com> wrote:
>
> > > > On Nov 20, 4:55 am, Marcus <marcus_cox2...@yahoo.com> wrote:
>
> > > > > On Nov 19, 8:54 pm, Ernie <eprimea...@gmail.com> wrote:
>
> > > > > > On Nov 19, 4:57 pm, Hunky Farrel <Hunkmeis...@asslickers.com> wrote:
>
> > > > > > > AdamUK schrieb:
>
> > > > > > > > Hello Enthusiasts,
>
> > > > > > > > I am currently doing an Architecture project where I will be designing a
> > > > > > > > plant and tree enthusiasts retreat in Bradgate park, Leicester.
>
> > > > > > > > Within this I think I would like to have :
> > > > > > > > A greenhouse,
> > > > > > > > A botany Laboratory
> > > > > > > > Access to the tree nursery
> > > > > > > > An Information Desk
> > > > > > > > As well as other mainstays such as bedrooms, dining etc.
> > > > > > > > I’ll be the first to admit that I don’t know much about plants, trees or
> > > > > > > > what enthusiasts/professionals would require or like in a building like
> > > > > > > > this, so if you would be so kind could you help me out?
> > > > > > > > Please reply with anything you would want or need in your dream venue
> > > > > > > > for learning, viewing and volunteering in plant research within my
> > > > > > > > building.
>
> > > > > > > > All your opinions or suggestions would be really appreciated
>
> > > > > > > > Thanks in Advance
>
> > > > > > > > Adam
>
> > > > > > > > P.S the project is for University, so budget is infinate :)
>
> > > > > > > i would like a special place for various lemon parties.
>
> > > > > > Is anybody going to believe anything posted by the crazy old pussy and
> > > > > > asshole farrel after seeing her lie about a mole being  a wart? Now
> > > > > > let the lying stupid whining cowardly vile HUNK of shit and convicted
> > > > > > child molester go finger herself, again. Ernie
>
> > > > > Asshole ernie shows us once again what an idiot she is.
>
> > > > > As I have been saying, Farrel has not posted here in about 7 years
> > > > > now.
>
> > > > > ernie `thinks` ( I use the term lightly) that the real Farrel is still
> > > > > here, and using of all names,  "Hunky Farrel"?
>
> > > > > Could asshole ernie possibly be any more stupid?
>
> > > > > Marcus
>
> > > > > P.S. prepare for auto-babble reply from asshole ernie
>
> > > > Is anybody going to believe anything posted by the crazy old pussy and
> > > > asshole farrel after seeing her lie about a mole being a wart? Now let
> > > > the lying stupid whining cowardly vile HUNK of shit and convicted
> > > > child molester go finger herself, again. Ernie
>
> > > And as predicted, auto-babble from asshole ernie.
>
> > > Nobody cares what the growth was that was removed from your ugly face.
>
> > > Marcus
>
> > Is anybody going to believe anything posted by the crazy old pussy and
> > asshole farrel after seeing her lie about a mole being a wart? ow let
> > the lying stupid whining cowardly vile HUNK of shit and convicted
> > child molester go finger herself, again. Ernie
>
> What is an ow let?
>
> Marcus

The crazy old pussy and asshole farrel was proven wrong about
inhibiting dht and 5 a-r being the answer for AGA, and she was proven
wrong about my method not working, now let the lying stupid whining
cowardly vile HUNK of shit and convicted child molester go finger
herself, again. Ernie