Page Glimpse
PageGlimpse.com is a SaaS provider which has a REST API for downloading website thumbnails by URI. This library wraps that interface to provide a Ruby-like means of interacting with it.
Note: The author of this gem is entirely unaffiliated with the PageGlimpse.com web service.
Getting Started
The following example shows how to use the PageGlimpse API:
gem 'page_glimpse'
require 'page_glimpse'
PageGlimpse.developer_key = 'abc123def456ghi789jkl123mno456pq'
if PageGlimpse.exist?('http://www.github.com')
image = PageGlimpse.get('http://www.github.com')
puts "Image type: #{image.content_type}" # => "image/jpeg"
puts "Image size: #{image.content_length}" # => 2572
puts "Image filename: #{image.filename}" # => nil or a name
# Save the transmitted binary (image.content) as a local file
File.open('github.jpg', File::CREAT|File::WRONLY|File::TRUNC) do |file|
file.write image.content
end
else
PageGlimpse.queue('http://www.github.com')
# and then try back later ...
end
Problems?
If you’re having troubles with or questions about the Page Glimpse web service, please email them to support [at] PageGlimpse.com
.
If you’re having issues with this Ruby library, specifically, please open a (or update an existing!) ticket on Lighthouse.
Contributing
To contribute to this library, fork it on GitHub and follow the contribution guide provided for the Ruby on Rails project.
Copyright
PageGlimpse.com is owned and operated by RADSense Software, Copyright © 2006 - 2009. Any and all questions about the Page Glimpse service should be directed toward support [at] PageGlimpse.com
.
Copyright © 2009 Nathaniel E. Bibler.
Released under the MIT License. See the LICENSE file for more details.