From 78aae20967f9bfb432612329f16de26cdcf6b4e1 Mon Sep 17 00:00:00 2001 From: yomguy Date: Sat, 3 Nov 2007 18:00:45 +0000 Subject: [PATCH] thumbs git-svn-id: http://svn.parisson.org/svn/tools/trunk@5 457c0346-1240-4656-8a5a-9edca8063506 --- webthumb_list.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 webthumb_list.py diff --git a/webthumb_list.py b/webthumb_list.py new file mode 100755 index 0000000..3cc63dc --- /dev/null +++ b/webthumb_list.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# Create thumbs of webpages from a list of URLs + +# depends : webthumb, imagemagick + +import os +import sys + +img_dir = '/var/www/img/thumbs' +site_list_file = '/var/www/img/thumbs/url_list.txt' + +def main(site_list_file, img_dir): + site_list = open(img_dir + os.sep + site_list_file,'r') + for site in site_list.readlines(): + site = site[0:len(site)-1] + command = 'webthumb http://'+ site +' | pnmscale -xysize 650 400 | ' + \ + 'pnmtopng | convert -crop 510x275+5+60 - ' + site +'.png' + print command + os.system(command) + site_list.close() + print 'Webthumbs created !' + +if __name__ == '__main__': + main(site_list_file, img_dir) \ No newline at end of file -- 2.39.5