David Thomas Baker » Web » Website Screenshot Thumbnail Creator Script

One day I needed to create thumbnails of about 300 websites, this would usually take a very long time, so I wacked together a simple shell script which makes use of Firefox, Xvfb, and Imagemagick

The script creates a virtual X desktop, starts a Firefox instance, and then, using the openUrl command, proceeds to load each website and capture a screenshot one at a time.

If you cannot get Xvfb working, you should be able to run this with little modification on a spare linux desktop. I suggest you play with image magicks cropping tools to remove the firefox decal.

here is the original bash script:
#!/bin/bash
echo "Starting virtual screen......";
Xvfb :3 -screen 3 1024x768x24 &
sleep 5;
export DISPLAY=:3;
# needed fluxbox becuase mozilla width/height wouldnt work without a w/m
echo "starting fluxbox....";
fluxbox &
sleep 20;
# start the firefox process full screen on the virtual buffer
echo "starting firefox.....";
mozilla-firefox -width 1024 -height 678 &
sleep 15;
for i in `cat sites.list`; do
echo "processing $i .....";
if ( host $i 2>&1 > /dev/null ); then
echo " ... $i exists..";
mozilla-firefox -remote "openUrl(http://www.$i)"
echo " ... waiting for page to load";
sleep 10;
import -display :3 -w root ~/web/$i.jpg;
convert -geometry 200x200 ~/web/$i.jpg ~/web/thumb/$i.jpg;
fi;
echo "..... done";
done;
Posted by David Baker in: Linux | Web |
Tags:
Perm Link: link
Some ads...

Search My Site

Featured Projects

Collector Comics is THE place to buy, sell, and research comics online. Launching soon.
Launch » Screenshot »
Webitor is a kick-ass easy to use, easy to extend, non-database driven Content Management System. Version 2 with reseller plan coming soon.
Launch » Version 1 »
GC Lounge is my own pet social network and test bed for social related code. Made by locals for locals.
Launch »
GG has indexed over half a million recent Trade Mark applications. This revolutionary tool is extremely valuable for industry experts.
Launch »
GCWiFi is the hub for techies interested in joining a ad-hoc wireless mesh spread across the Gold Coast
Launch »
Web based financial client management system
Launch »
OS Commerce modules and template modification
Launch »
View More Projects »

Daves Friends

BlueTeddy
WebSpark
GC Designer Forum
IPWealth Trademarks
Cheap Websites
Bonsai Shop
Webitor CMS Resellers
Hayley Crook
David Novakovic
Ben Novakovic
Richard Morwood
Gold Coast Linux
Aussie Click
CMS Website Design
Inspire Tuition
Gold Coast Music Network and Gold Coast Gig Guide

Chat with Dave

Powered by...

In the works

Webitor - Easy to use Content Management System with Shop, Newsletter, and Reseller plan