Jump to content

thumbnail-web-screenshots-script with php


dilbertone

Recommended Posts

 

imagegrabscreen — Captures the whole screen - a PHP-script that scrapes 500 different sites and stores the results as thumbnails

 

 

 

This example demonstrates how to take a screenshot of the current screen and save it as a png image.

 

 

imagegrabscreen

 

as a base for a  webscraper that runs with PHP and collects images  i thought we c

 

 

note  - all i need are previews or thumbnails  i do not need fully fledged images.

 

 

<?php

$im = imagegrabscreen();

imagepng($im, "myscreenshot.png");

imagedestroy($im);

?>

 

 

 

 

 

 

This example demonstrates how to take a screenshot of the current screen and save it as a png image.

 

well - to spell it out. i need approx 500 to 1000 webshots ( images that are stored as thumbnails with 240 pixels at the long distance at maximum.

 

what do you  guess. i think  it should be pretty obvious but I'll mention it anyway, if we re running GPU-intensive applications (not CPU), calling this

function will cause quite some significant lag to our machine and server response until the request is complete.

For this to work our Apache service must be set to 'Allow service to interact with desktop' otherwise we will just get a blank image.

 

Question: how to implement the long list of 500 URLS that i have to visit and create a thumbnails?

 

 

 

imagegrabscreen only works on windows and it grabs the current screenshot that you see on your monitor.  It does not load websites and render them.

 

You will have to find a third party solution for this, PHP cannot do it by itself.

 

You can attempt to:

1)  Figure out how to pass URLs to firefox, then use imagegrabscreen to take screenshots of your entire desktop, which you will have to trim later.

 

2)  See if you can exploit the rendering engine and plugins of firefox or chrome, the firefox plugin ScreenGrab might be useful to you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.