views:

273

answers:

4

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

+1  A: 

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

Nick D
A: 

Hi,

check out this link. it may helpful

Cheers

Ramesh Vel

Ramesh Vel
+1  A: 

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

jonasl