Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


website thumbnail generator
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

website thumbnail generator

alexalex Member

I'm looking for recommendations for a website thumbnail generator. It's for generating thumbnails in DomainAgent. Any size would do, and it has to be free.
Any help appreciated!

Comments

  • Most of the free services can be bogged down (slow response) due to mass requests.

    I'd recommend using PhantomJS to capture your own screenshots/thumbnails. All you have to do is download the binary (1 file, and works on any Linux OS).
    With PhantomJS, you're looking at 100 MB ram usage on OpenVZ.

    ^ New versions of PhantomJS are true headless (no X11), but they no longer capture flash. If you wish to capture flash within screenshot/thumbnail, you'll need to build v1.4.1.

    Note: You could easily create your own API for your project

  • MunMun Member
    edited May 2013

    could always use shrink.munroenet.com/shrink.php

    Example format: http://shrink.munroenet.com/shrink_new.php?img=http://forums.gaming-servers.net/uploads/FileUpload/87/4484b8a8122186ea2c79e6b511757b.png&comp=35&h=400&w=300

    where:
    img= URL path
    comp= compression percent
    h= height
    w= width

    I might make the script open source, but im not fully happy with it :)

    Mun

  • vldvld Member
    edited May 2013
    function generate_thumb($url) {
        $data = json_decode(file_get_contents('https://developers.google.com/_apps/pagespeed/run_pagespeed?run_dependency_analysis=off&format=json&url='.urlencode($url)), true);
        if(isset($data['status_code']) && $data['status_code'] == 'OK') {
            return array('title' => $data['document_title'], 'image_binary' => base64_decode($data['image']['data']));
        }
        return false;
    }
    

    I wrote this a while ago and it served me well. Returns a 320x240 jpeg image. Probably Google doesn't like it, but, eh.

  • DalCompDalComp Member

    @Mun said:
    could always use shrink.munroenet.com/shrink.php

    I think your script is for resizing images, much like timthumb, but doesn't generate the website screenshot itself.

    @vld said:
    I wrote this a while ago and it served me well. Returns a 320x240 jpeg image. Probably Google doesn't like it, but, eh.

    Is that "stealing" from Google Pagespeed? Nice. lol.

  • @vld said:

    > function generate_thumb($url) {
    >   $data = json_decode(file_get_contents('https://developers.google.com/_apps/pagespeed/run_pagespeed?run_dependency_analysis=off&format=json&url='.urlencode($url)), true);
    >   if(isset($data['status_code']) && $data['status_code'] == 'OK') {
    >       return array('title' => $data['document_title'], 'image_binary' => base64_decode($data['image']['data']));
    >   }
    >   return false;
    > }
    > 

    I wrote this a while ago and it served me well. Returns a 320x240 jpeg image. Probably Google doesn't like it, but, eh.

    How to make it working?

  • vldvld Member
    edited May 2013

    @thuvienvps said:
    How to make it working?

    Just an example, make sure you sanitize the title (if you're going to output it to the user) and the filename. You can add some more error cases if desired.

    <?php
    $image_file = 'thumb.jpg';
    $thumb = generate_thumb('lowendtalk.com');
    if(is_array($thumb) && file_put_contents($image_file, $thumb['image_binary'])) {
        echo $thumb['title'].' has been saved to '.$image_file;
    } else {
        echo 'error';
    }
    ?>
    
  • awsonawson Member
    edited May 2013

    Speaking of abusing internal APIs, I think it might be possible to take advantage of Chrome World Wide Maze's website generation app. I'll take a look at it in a while.

  • vedranvedran Veteran

    As @telephone suggested, do it yourself with PhantomJS, it's very simple to use it and it works amazingly well.

  • alexalex Member

    @vedran said:
    As telephone suggested, do it yourself with PhantomJS, it's very simple to use it and it works amazingly well.

    Not a chance. It is a PHP script that is to be deployed by people which won't have a clue how to do it.

  • vedranvedran Veteran

    What I meant (and what @telephone suggested) is making your own API, I wouldn't rely on a third party public free API. Some time ago I was looking for the same thing, and whatever I found was either terribly slow, limited, or already dead.

  • alexalex Member

    nah, not going to reinvent the wheel

  • prae5prae5 Member

    Check out http://snapcasa.com/

    Its lists lots of sites that do it, last time i checked a number of them offered free / limited api levels.

    I used a couple for a project once but ended up disabling the feature, as it wasn't the greatest idea in the end.

  • alexalex Member

    tried it already, most of them is crap, however this one looks primising:
    http://pagepeeker.com/free-thumbnails/

  • vahevahe Member

    I think you're looking for something like this: bitpixels.com

  • PagePeeker is a popular free one that I see used quite a lot. They put their logo in the bottom corner of the image tho unless you pay to use the service.

Sign In or Register to comment.