websitethumbs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
websitethumbs [2006/11/09 17:40] – 205.252.23.7 | websitethumbs [2008/06/16 18:16] (current) – 82.69.46.186 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Website Thumbnails ====== | ||
+ | Sometimes you may want to create thumbnail previews of some webpages (eg. for a link list). Instead of doing this manually you can script it, too. | ||
+ | |||
+ | The following script need the [[http:// | ||
+ | |||
+ | To install the latter on [[Debian]]: | ||
+ | |||
+ | #> apt-get install xvfb | ||
+ | |||
+ | Create a file named '' | ||
+ | |||
+ | $> xvfb-run -s ' | ||
+ | |||
+ | ===== webthumb.sh ===== | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | |||
+ | URLS=urls.txt | ||
+ | IMAGES=images | ||
+ | mkdir -p $IMAGES | ||
+ | |||
+ | echo " | ||
+ | opera -geometry 1024x768+0+0 -nosplash & | ||
+ | sleep 20 | ||
+ | echo " | ||
+ | |||
+ | for url in `cat $URLS` | ||
+ | do | ||
+ | md5=`echo -n " | ||
+ | img=" | ||
+ | if [ -e " | ||
+ | then | ||
+ | #nothing | ||
+ | echo -n '' | ||
+ | else | ||
+ | echo " | ||
+ | opera -remote " | ||
+ | sleep 7 | ||
+ | xwd -root -screen |xwdtopnm |pnmcut 4 170 1020 594|pnmscale -xysize 170 170 |pnmtojpeg> | ||
+ | echo "$img created" | ||
+ | fi | ||
+ | done | ||
+ | </ |
websitethumbs.txt · Last modified: 2008/06/16 18:16 by 82.69.46.186