SO Systems Computer Service - IT Service aus einer Hand
<br />
<b>Notice</b>:  Undefined variable: slidescaption1 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />
<br />
<b>Notice</b>:  Undefined variable: slidescaption2 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />
<br />
<b>Notice</b>:  Undefined variable: slidescaption3 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />
<br />
<b>Notice</b>:  Undefined variable: slidescaption4 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />
<br />
<b>Notice</b>:  Undefined variable: slidescaption5 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />
<br />
<b>Notice</b>:  Undefined variable: slidescaption6 in <b>/var/www/vhosts/so-systems.com/httpdocs/templates/meembo-red/index.php</b> on line <b>146</b><br />

Automatisches Erstellen von Screenshots einer Website

Manchmal ist eine Vorschau der Homepage per Screenshot erforderlich, beispielsweise für Webhoster oder auch für den Eigengebrauch.

Das lässt sich recht einfach mit einem Linuxsystem realisieren.

Das einzige, was wir brauchen, ist ein Linux (in meinem Fall Ubuntu), VNC (optional) und imagemagick

Hier mein Skript:

 
#!/bin/sh
#apt-get install imagemagick
# start a server with a specific DISPLAY

# start firefox in this vnc session
#DISPLAY=:12
#vncserver $DISPLAY -geometry 1024x768

screenshotdir=screenshots
mkdir -p $screenshotdir
killall firefox
#firefox --display $DISPLAY &

# read URLs from a data file in a loop
count=1
while read url
do
# send URL to the firefox session
firefox --display $DISPLAY $url &
filename=$(echo $url |tr -d .:/)
# take a picture after waiting a bit for the load to finish
sleep 5
import -window root $screenshotdir/$filename.jpg
# killall firefox
done < url_list.txt

# clean up 

# Ende