yuli chika
yuli chika

Reputation: 9221

How to get a site screenshot quickly using PHP?

I want to create a web directory site, and I need to get these site screenshots. How to get a site screenshot quickly using PHP? I tried IECAPT,webscreencapture, khtml2png, but they are all slowly. And they all get screenshot one url by one url. Is IECAPT depends on a ie browser? if it is, why it can not open many ie tags so that work at the same time? Is there anyone can recommend me a PHP screenshots software using online? according to my above requirements? Thank you.

Upvotes: 2

Views: 5580

Answers (4)

yuli chika
yuli chika

Reputation: 9221

I have tried CutyCapt, I copied 3 CutyCapt.exe and renamed them. But it also catch the screenshot one by one , not run the 3 processes at one time.

<?php
set_time_limit(0);
$url1 = 'http://www.google.co.uk';
$out1 = '1.jpg';
$path1 = 'CutyCapt1.exe';
$cmd1 = "$path1 -u=$url1 -o=$out1";
//exec($cmd); 
system($cmd2); 
$url2 = 'http://www.google.com';
 $out2 = '2.jpg';
 $path2 = 'CutyCapt2.exe'; 
$height2 = '1200 ';
 $cmd2 = "$path2 -u=$url2 -o=$out2"; 
//exec($cmd); 
system($cmd2); 
$url3 = 'http://www.google.co.jp'; 
$out3 = '2.jpg';
 $path3 = 'CutyCapt3.exe';
 $height3 = '1200 '; 
$cmd2 = "$path3 -u=$url3 -o=$out3"; 
//exec($cmd); 
system($cmd3);`
?>

I do not think many thumbnail service site, like pageglimpse.com, they install many browsers on their web servers. What is the technology they use?

Upvotes: 0

Tolstoi
Tolstoi

Reputation: 21

These external services are developing fast. Take a look at: http://immediatenet.com/thumbnail_api.html it renders thumbnails extremely fast and caches them like the other similar services.

Upvotes: 2

coreyward
coreyward

Reputation: 80060

Your requirements are unrealistic. Your best bet is to integrate with WebKit through something like CutyCapt that doesn't run an actual browser, but just the WebKit rendering engine. You shouldn't have any concurrency issues, but it it isn't going to be fantastic.

Upvotes: 3

AndreKR
AndreKR

Reputation: 33678

Probably the easiest way is to use an external service. There used to be Alexa Site Thumbnail but it has been discontinued, so you must look for alternatives. For example http://www.pageglimpse.com/ seems to be one.

Upvotes: 0

Related Questions