lwr-simple

LWR::Simple library is yet another LWP::Simple library for ruby.

SYNOPSIS:

It is an interface that assumes the scene to which LWR::Simple is taken an active part by the one liner like begin so LWP::Simple, too. Its interface really looks like the LWP::Simple.

# example. 1
$ ruby -rlwr-simple -e 'getprint "http://www.sn.no"'

# example. 2
$ ruby -rlwr-simple -e 'get("http://www.ruby-lang.org/ja/").scan(/<a.*href="(.+?)"/) {|refs| puts(refs[0])}'

FEATURES:

LWR::Simple library provides 5 methods in toplevel.

  • get(url)

  • head(url)

  • getprint(url)

  • getstore(url, file)

  • mirror(url, file)

All methods looks like the LWP::Simple library. Please refer to rdoc for details.

REQUIREMENTS:

Self operation capabilities on ruby 1.8.6 or more. Probably, it operates on ruby 1.8.3. (relation of dependence on “net/http” library.)

INSTALL:

It is not possible to prepare it. It is only git for a while in now. Sorry…

Install by git, see

git clone git://github.com/yagihiro/lwr-simple.git
cd lwr-simple
rake gem
rake install_gem

LICENSE:

Copyright © 2008 Hiroki Yagita

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

AUTHOR:

Hiroki Yagita <[email protected]> d.hatena.ne.jp/clayfish/