# How to take thumbnail of a website using Ruby?

**URL:** <https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984>\
**Category:** Ruby\
**Created:** [March 16, 2007, 7:53am UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984 "2007-03-16T07:53:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 7:53am UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/1 "2007-03-16T07:53:30Z")

</div>

Hello folks,

How could I take a screenshot of a web site using Ruby on a shared  
hosting? There’s no X server on the server, is there a way to take a  
screenshot using imagemagick or something else?

Thanks,

- Dunnil

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 10:28am UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/2 "2007-03-16T10:28:39Z")

</div>

Human D. wrote:

> Hello folks,
> 
> How could I take a screenshot of a web site using Ruby on a shared  
> hosting? There’s no X server on the server, is there a way to take a  
> screenshot using imagemagick or something else?
> 
> Thanks,
> 
> - Dunnil

I’d be surprised if the first step in the easiest way to do this wasn’t  
(1) install an X server.

This is sort of a way to do it using RubyGnome. But again, needs X, Gtk  
and Ruby-gnome: [http://rubyurl.com/Yjk](http://rubyurl.com/Yjk)

There was definitely a website out there that would take pictures of  
your page for you, on different platforms, but I can’t seem to find it.  
Perhaps it would be possible to hook up with that.

best,  
Dan

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 11:09am UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/3 "2007-03-16T11:09:54Z")

</div>

> There’s no X server on the server, is there a way to take a  
> screenshot

Not only do you need an X-Server to provide the libs to take  
screenshots, but you’ll also need it to have something you can take a  
screenshot OF. If you can’t display a browser, you can’t take a  
screenshot of it.

Are you looking for something like this:  
[http://www.snap.com/about/spa1B.php](http://www.snap.com/about/spa1B.php) or this  
[cooliris.com](http://www.cooliris.com/Site/index.html) ?

-Tim

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 1:15pm UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/4 "2007-03-16T13:15:09Z")

</div>

What you need is not to take a picture exactly but rather than  
rendering it to a monitor, render it to a file.  
You could run some instance of a rendering engine. (Gecko for example)  
The easiest way is to simply use a browser but there must be another  
way.  
This is like Snap and it’s annoying mouseOver popups

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/5 "2007-03-16T12:29:00Z")

</div>

On Friday 16 March 2007 06:51, Human D. wrote:

> Hello folks,
> 
> How could I take a screenshot of a web site using Ruby on a shared  
> hosting? There’s no X server on the server, is there a way to take a  
> screenshot using imagemagick or something else?
> 
> Thanks,
> 
> - Dunnil

well i’m working on scrpt that an do that, but you probably won’t be  
able to  
do this without x server.

check this:  
[khtml2png download | SourceForge.net](http://khtml2png.sourceforge.net/index.php?page=about) (uses khtml  
rendering  
engine, not sure if it requires X)  
[http://pearlcrescent.com/products/pagesaver/](http://pearlcrescent.com/products/pagesaver/) (uses firefox with plugin,  
I’m  
SURE it requires X+Firefox, poblably no way to install plugin on shared  
hosting too)

if you wrtite the script, please share your expirience, you can e-mail  
me  
directly ^^

Greets

---

<div class="post-metadata">

**Author:** ![Human\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@Human\_D](https://www.ruby-forum.com/u/Human_D)\
**Post date:** [March 16, 2007, 2:37pm UTC](https://www.ruby-forum.com/t/how-to-take-thumbnail-of-a-website-using-ruby/88984/6 "2007-03-16T14:37:23Z")

</div>

You could render it with links 🙂 and no it’s not just text only.  
There are several versions of links. In particular the links by  
twibright labs [http://links.twibright.com/](http://links.twibright.com/) has a graphical rendering  
mode. Since it renders to a frame buffer (and doesn’t need X) you can  
probably render to a raw file or somfin instead, then convert to a  
png, and viola, screenshot sans X.

Of course yea, geko and konq also could do this, but I don’t know how  
common it is to find them detached completely from X.

my 2\*$0.01… or what… 2 0.001\*euros?

–Kyle
