website screenshot server on debian stable
Posted by olivM on Mon 10 Jul 2006 at 15:02
Despite being both great and free the online service thumbshots, which is used to create images of what a website looks like, can't be used for professional use. Here we'll demonstrate how to reproduce that service ourselves.
Here is how we'll create our own website screenshot service on a Debian stable server in less than 10 minutes.
First install vncserver, a simple desktop environment, a web browser and a tool to export images :
apt-get install vncserver xfonts-base xfce4 mozilla-firefox imagemagick
Start the vncserver service :
vncserver :1 -geometry 1024x768 -depth 24
Configure the desktop and browser to your own preferences. You'll probably wish to remove any unnecessary panels, session-managers, etc, and install some plugins for your browser:
killall x-session-manager ssh-agent xftaskbar4 xfdesktop xfce4-panel
Now you can open a session to your server's desktop environment to see how it's looking :
xvncviewer x.x.x.x:1 &
The next step is to create a simple script to take a screenshot of a given website. We'll call our script screenshot.sh, and give it the following contents:
#!/bin/bash export DISPLAY=":1" /usr/bin/firefox --display :1 "$1" > /dev/null 2> /dev/null & /bin/sleep 10 /usr/bin/import -window root -display :1 "$2" killall firefox-bin
The script can be called as follows:
./screenshot.sh http://www.debian-administration.org/ ~/debian_admin.jpg
That's it !
This article was inspired by Anton Titov's post on How to make site screenshots with linux server.
it's fixed
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
Thanks for the writeup!
[ Parent | Reply to this comment ]
Works also with xvfb (Virtual Framebuffer 'fake' X server).
Xvfb :1 -screen 0 1024x768x24 &
[ Parent | Reply to this comment ]
THX Josh
[ Parent | Reply to this comment ]
http://blogs.nitobi.com/jake/index.php/2007/05/09/website-screens hots-on-linux/
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
user_pref("browser.sessionstore.enabled", false);
to your /perso_dir/.mozilla/firefox/idffjglkg.default/prefs.js
idffjglkg.default and perso_dir are not the same for you ;)
[ Parent | Reply to this comment ]
Instead, you might want to consider using a Firefox/Iceweasel add-on called Peal Crescent Page Saver. You can then give Firefox an argument to capture the entire page, regardless of size.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message ]
xbase-fonts should be xfonts-base :)
Thanks for the great article, I'm running apt-get on my server now :)
[ Parent | Reply to this comment ]