An open API service indexing awesome lists of open source software.

https://github.com/grimen/page_glimpse

Ruby: A little Ruby wrapper for the PageGlimpse API for generating webpage snapshots - glimpses - in a snap.
https://github.com/grimen/page_glimpse

Last synced: 22 days ago
JSON representation

Ruby: A little Ruby wrapper for the PageGlimpse API for generating webpage snapshots - glimpses - in a snap.

Awesome Lists containing this project

README

        

h1. PAGE_GLIMPSE

A little Ruby wrapper for the *PageGlimpse API* for generating webpage snapshots - glimpses - in a snap.

h2. What Is PageGlimpse?

"http://pageglimpse.com":http://pageglimpse.com

h2. Installation

Dependency:

sudo gem install jnunemaker-httparty

Gem:

sudo gem install grimen-page_glimpse

h2. PageGlimpse API Key

You'll need a API key, which you can get for *free* here:

"http://pageglimpse.com/signup":http://pageglimpse.com/signup

h2. Usage/Examples

Initialize:

snapper = PageGlimpse.new('ec0ccd....26df') # => nil

Tell PageGlimpse to generate a webpage thumbnail:

snapper.request!('http://mypage.com') # => true/false

Check if thumbnail exists for a webpage:

snapper.exists?('http://techcrunch.com', :size => :medium) # => true/false

Get direct URL for a cached webpage thumbnail image:

snapper.thumbnail_url('http://techcrunch.com', :size => :large) # => 'http://images.pageglimpse.com/v1/thumbnails?url=http://techcrunch.com&size=large&devkey=ec0ccd....26df'

Get thumbnail (PNG image) for a webpage:

snapper.thumbnail('http://techcrunch.com', :size => :small) # => [raw PNG data]

Save thumbnail into a file (PNG image) for a webpage:

snapper.save!('http://techcrunch.com', '/Users/kid_icarus/techcrunch_thumbnail.png', :size => :large) # => true/false

h2. More?

Yes, all the PageGlimpse API options are supported but not documented in this README right now. Peep the code and read more about the options: "http://www.pageglimpse.com/features/api":http://www.pageglimpse.com/features/api.

h2. License

Copyright (c) Jonas Grimfelt, released under the MIT-license.