I want to know technique to capture screenshot if I have a url list of those sites like google fastflip. What technology or techniques require for this kind of task. If this technique available in rails it would be great.
Thanks
I want to know technique to capture screenshot if I have a url list of those sites like google fastflip. What technology or techniques require for this kind of task. If this technique available in rails it would be great.
Thanks
You'll need a HTML rendering engine for that.
The easy way is to use a browser plugin for that task.
Check out this: 15 Ways To Create Website Screenshots
You need to convert html markup to image using Webkit
Following links can be helpful even if language is not ruby
http://cfsilence.com/blog/client/index.cfm/2008/4/5/More-Thoughts-on-HTML-To-Image-Plus-Code http://cfsilence.com/blog/client/index.cfm/2008/4/4/Converting-HTML-To-An-Image-With-CFJava http://www.coldfusionjedi.com/index.cfm/2007/6/13/ColdFusion-8-URL-Thumbnails
Hey, i'm using a headless webbrowser and Xvfb. First, install the package dependencies for example Ubuntu:
sudo apt-get install xvfb imagemagick x11-apps
Then run the shellcript below using sudo to some "nobody user", like this: /usr/bin/sudo -u nobody /path/screengrab.sh www.ibm.com 34344 >>/tmp/screengrab.log 2>&1
You might need to adjust the cropping etc.
#!/bin/bash
rm -rf /home/nobody/.mozilla/
XAUTHORITY=
Xvfb :$2 -pixdepths 32 -screen 0 1024x1024x24 >/dev/null 2>&1 & XPID=$!
sleep 1
firefox -width 2000 -height 1024 --display :$2 http://$1 & FPID=$!
sleep 6 xwd -display :$2 -root -out /tmp/$2-$$.xwd
convert /tmp/$2-$$.xwd /u0/screengrabs/$1.png # Cache convert -resize 300x300 /tmp/$2.xwd /tmp/$2-$$.png convert -crop 287x248+0+29 /tmp/${2}-$$.png /tmp/${2}2-$$.png
mkdir -p /home/je/www/domaintool.se/docs/images/$1
cp /tmp/${2}2-$$.png /home/je/www/domaintool.se/docs/images/$1/date +%Y%m%d
.png
rm -f /tmp/$2-$$.png /tmp/$2-$$.xwd /tmp/${2}2-$$.png
kill $XPID >/dev/null 2>&1 kill $FPID >/dev/null 2>&1