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?

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.