I recently had a need to take screenshots of webpages dynamically. What I came up with was a simple PHP cron and que that calls a very basic shell script.
#!/bin/bash export DISPLAY=":1" /usr/bin/opera -remote "raise()" /usr/bin/opera -remote "openURL($1)" & /bin/sleep $6 /usr/bin/import -window root -display :1 -resize $3x$4 -quality $5 "$2"
I then call this script with a command in php
screenshot.sh www.url.com /tmp/tempfile.jpg 1024x768 75 15
This will take a load www.url.com for 15 seconds and save a 1024x768px screenshot to /tmp/tempfile.jpg