snapurl

Take snapshots of web pages. This is a Ruby/RubyCocoa port of the webkit2png.py script by Paul Hammond (www.paulhammond.org/webkit2png/) with some minor modifications.

See also: www.jurisgalang.com/articles/show/SnapUrl

Requirements:

* OS X only.
* RubyCocoa (Leopard and Snow Leopard will already have this installed)
* Ruby 1.8.7 (Ruby 1.9.x wont play with RubyCocoa)

If you intend to work with the source and do your own builds, the project expects that you have the following gems installed:

* gemcutter
* jeweler
* rcov
* thoughtbot-shoulda

Installation

$ sudo gem install snapurl

This gem is published at gemcutter (gemcutter.org), so you’ll need to add it as a gem source (unless you already have):

$ gem sources -a http://gemcutter.org

Alternatively you can build the gem from source and install:

$ git clone git://github.com/jurisgalang/snapurl.git
$ cd snapurl
$ rake gemspec install

To build and install a specific tag:

$ git clone git://github.com/jurisgalang/snapurl.git
$ cd snapurl
$ git checkout -f -b `whoami`-snapurl v0.0.3
$ rake gemspec install

Install RubyCocoa

If you have a custom Ruby installation then you’ll also need to do a custom build and install of RubyCocoa. I’ve bundled the latest release source and a script to do this for you:

$ cd snapurl
$ ./thirdparty/install-cocoa

NOTE: Your custom Ruby installation must have had –enable-shared flag on when you built it.

Usage

Just pass a list of URLs to the snapurl script and it will take a snapshot of the pages found in those URLs:

$ snapurl http://artists.gawker.com/                  # takes a snapshot of gawker artists
$ snapurl http://io9.com/ http://artists.gawker.com/  # ... and io9 websites.

By default snapurl generates a set of files per URL that it processes: thumbnail, clipped, and full-sized view of the web pages in PNG format.

Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but
  bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

License

(The MIT License)

Copyright © 2008, 2009 Juris Galang

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.

Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.

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.