1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

get thumbnail of website

Discussion in 'PHP' started by bobby9101, Apr 18, 2006.

  1. #1
    i have a directory running, and i was wondering if there is some way that php can create a screenshot of a given site, and dynamically produced say a 100*100px thumbnail. any ideas?
     
    bobby9101, Apr 18, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    I think it would be terribly difficult to do in PHP. You first would need to develop an HTML/CSS rendering engine for PHP (I've never heard of such a thing for PHP). Which basically means you would first need to develop a browser from scratch in PHP.
     
    digitalpoint, Apr 18, 2006 IP
  3. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #3
    haha thanks shawn, guess i won't be undertaking this one :)
    just a question though: how does alexa and thumbshots.org do it though
     
    bobby9101, Apr 18, 2006 IP
  4. Cypher_489

    Cypher_489 Active Member

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #4
    Why not use Alexa's thumbnail? Use PHP similar to this (Notice the part in bold):

    <?php echo "<img src="http://thumbnails.alexa.com/image_server.cgi?size=large&url=$siteurl">"; ?>

    $siteurl being the URL to the site in your directory
     
    Cypher_489, Apr 18, 2006 IP
  5. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #5
    because, they don't have every site indexed :)
     
    bobby9101, Apr 18, 2006 IP
  6. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Some people have been successful installing a windowing system and browser on their server and using php (via shell calls) to open a website in the browser, take a screenshot, resize it and save it to a database. But even that can be an undertaking. If you're interested you can search for it people have already done it.
     
    exam, Apr 18, 2006 IP
  7. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I found a german site that can handel the thumbs for you. www.thumbshot.de

    If you need a little help i can do some translating for you.
     
    hansi, Apr 18, 2006 IP
  8. anjanesh

    anjanesh Well-Known Member

    Messages:
    343
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    165
    #8
    Is there a url in that site that can output the image if the url is given ?
    Say, thumbshot.de?url=digitalpoint.com ?
     
    anjanesh, Apr 18, 2006 IP
  9. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hansi, Apr 18, 2006 IP
  10. anjanesh

    anjanesh Well-Known Member

    Messages:
    343
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    165
  11. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I'm not sure how long it takes to create the thumb. But when it's done you can see it all the time.
     
    hansi, Apr 19, 2006 IP
  12. anjanesh

    anjanesh Well-Known Member

    Messages:
    343
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    165
    #12
    But what I get is a blank GIF image all the time. If it takes time to generate the image, then FireFox will show that its still waiting to accept data from the server - but it seems its getting a connection close.
     
    anjanesh, Apr 19, 2006 IP
  13. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    hansi, Apr 19, 2006 IP
    sarahk likes this.
  14. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #14
    I'd like to use it, and I'd give credit, but it would be great if they could give a placeholder for sites they haven't indexed yet.

    Infact, what would be useful is if you could query them first with something like thumbshots.de/cgi-bin/available.cgi?url=digitalpoint.com

    and it could return a one char text string of 0 or 1 if the image was available. Then I could either request the image or not. Hopefully the request would also trigger the creation of the image so next time it will be there.
     
    sarahk, Apr 19, 2006 IP
  15. anjanesh

    anjanesh Well-Known Member

    Messages:
    343
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    165
    #15
    Oh...I thought it was generating the image on the fly. If it was on the fly then its worth backlinking - but backlinking for cached images - I dont think its worth.
     
    anjanesh, Apr 19, 2006 IP
  16. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Ahm i think on-the-fly won't be possible, the "bot" must surf to the site to and is doing a screenshot from it. And why not use cached images? Most websites don't update so often that the screen looks really different.

    There is one more script with that you can update every 24h.
    http://thumbshot.de/cgi-bin/update.cgi?url=[LINK]
     
    hansi, Apr 19, 2006 IP
  17. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #17
    sarahk, Apr 19, 2006 IP
  18. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #18
    add http:// infront
     
    hansi, Apr 19, 2006 IP
  19. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #19
    Hansi, this is awesome and could be just what I'm looking for over on www.top100vbulletin.com.

    Do you know the guys involved?

    I'd like to actually retrieve the image and host it locally but refresh them monthly - so I could do that using the update request and then a day later request the thumbnail. As I've said, I'd give credit.

    Would that kind of use be acceptable?
     
    sarahk, Apr 19, 2006 IP
  20. hansi

    hansi Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #20
    hansi, Apr 19, 2006 IP