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.
- Host: GitHub
- URL: https://github.com/grimen/page_glimpse
- Owner: grimen
- License: mit
- Created: 2009-05-12T23:26:15.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2009-08-20T15:37:57.000Z (almost 16 years ago)
- Last Synced: 2025-04-17T11:21:32.457Z (about 1 month ago)
- Language: Ruby
- Homepage: http://rdoc.info/projects/grimen/page_glimpse
- Size: 87.9 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: MIT-LICENSE
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-httpartyGem:
sudo gem install grimen-page_glimpseh2. 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') # => nilTell PageGlimpse to generate a webpage thumbnail:
snapper.request!('http://mypage.com') # => true/falseCheck if thumbnail exists for a webpage:
snapper.exists?('http://techcrunch.com', :size => :medium) # => true/falseGet 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/falseh2. 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.