What thumbnail script is this?

Status
Not open for further replies.
4 comments
Try webthumbnail.org, real easy to use API. Not sure if they support adult sites in their terms though.
 
However you'll need imagemagick and wkhtmltopdf:

Code:
sudo aptitude install imagemagick wkhtmltopdf

PHP:
<?php 
// save this snippet as url_to_png.php
// usage: php url_to_png.php http://example.com
if (!isset($argv[1])){
    die("specify site: e.g. http://example.com\n");
}
 
$md5 = md5($argv[1]);
$command = "wkhtmltopdf $argv[1] $md5.pdf";
exec($command, $output, $ret);
if ($ret) {
    echo "error fetching screen dump\n";
    die;
}
 
$command = "convert $md5.pdf -append $md5.png";
exec($command, $output, $ret);
if ($ret){
    echo "Error converting\n";
    die;
} echo "Conversion compleated: $argv[1] converted to $md5.png\n";
 
Thank you for your replies guys!

OneManCrew, do you know how to install wkhtmltopdf? :)

__________________
Added after 22 Hours 16 minutes:

Ok, is now installed...
But how to use that script? What should I do?

They say:
// usage: php url_to_png.php Example Domain

I tried this code but didn't worked:
PHP:
<?php url_to_png.php http://www.google.com ?>

If I open the file using http://www.mydomain.com/url_to_png.php appears the message:
specify site: e.g. Example Domain

Help!

Thank you :)
 
Last edited:
Status
Not open for further replies.
Back
Top