Forum: Ruby urlgrabber in Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pau Garcia i Quiles (Guest)
on 2006-05-06 03:34
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm looking for something like the Python-esque URLGrabber package, but
in
Ruby. Any tip?

* urlgrabber is a pure python package that drastically simplifies the
fetching
of files. It is designed to be used in programs that need common (but
not
necessarily simple) url-fetching features. It is extremely simple to
drop
into an existing program and provides a clean interface to
protocol-independant file-access. Best of all, urlgrabber takes care of
all
those pesky file-fetching details, and lets you focus on whatever it is
that
your program is written to do!
http://linux.duke.edu/projects/urlgrabber/

Thank you.

- --
Pau Garcia i Quiles
http://www.elpauer.org
(Due to the amount of work, I usually need 10 days to answer)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEW+BK/DzYv9iGJzsRAvLrAKDHpkyCRD/J3tRwQNq8dwGajtDQRQCg5urg
m+Bm2DpWoiEqur5Nwrpgt1M=
=HGxE
-----END PGP SIGNATURE-----
Mully (Guest)
on 2006-05-06 05:39
Pau Garcia i Quiles wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I'm looking for something like the Python-esque URLGrabber package, but
> in
> Ruby. Any tip?
>
> * urlgrabber is a pure python package that drastically simplifies the
> fetching
> of files. It is designed to be used in programs that need common (but
> not
> necessarily simple) url-fetching features. It is extremely simple to
> drop
> into an existing program and provides a clean interface to
> protocol-independant file-access. Best of all, urlgrabber takes care of
> all
> those pesky file-fetching details, and lets you focus on whatever it is
> that
> your program is written to do!
> http://linux.duke.edu/projects/urlgrabber/
>
> Thank you.
>
> - --
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to the amount of work, I usually need 10 days to answer)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFEW+BK/DzYv9iGJzsRAvLrAKDHpkyCRD/J3tRwQNq8dwGajtDQRQCg5urg
> m+Bm2DpWoiEqur5Nwrpgt1M=
> =HGxE
> -----END PGP SIGNATURE-----


"open-uri" might serve your purposes. It allows you to work with
http/ftp resources as you would a normal file object:

  open("http://www.ruby-lang.org/") {|f|
    f.each_line {|line| p line}
  }

http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdo...

Mully
This topic is locked and can not be replied to.