SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    screenshot of web page using php

    How can we get the screenshot the live web page using php.

  2. #2
    I Never Give Up roosevelt's Avatar
    Join Date
    May 2005
    Posts
    515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The basic idea is to make it like this:

    1) Install a browser in the server.

    2) Using commands run the browser, open up the URL, use Perl script to take screenshots.

    I don't know the exact codes but to save time you could just this the following services:

    http://images.websnapr.com/?url=yourdomain.com&size=t
    http://www.webshotspro.com/
    http://www.thumbalizr.com/

    Basically use them to generate the thumbnail and do get_file_contents() to get the thumbnail .

    Here's something you can use in your own server:

    http://hasin.wordpress.com/2006/09/0...age-using-php/

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    New Jersey, USA
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use http://www.girafa.com/ on my site. They offer 2000 free thumbnails per day.

  4. #4
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by roosevelt View Post
    The basic idea is to make it like this:

    1) Install a browser in the server.

    2) Using commands run the browser, open up the URL, use Perl script to take screenshots.
    There are scripts that do that, but none of the UNIX compatible browsers can report back to an external application, when the URL that it's told to load has loaded. The freely available scripts that I have seen, use a time setting to do the screen shot. If the page hasn't loaded in that time, you get nothing. You would have to have a custom solution that embeds a browser engine, and therefore would have access to the events triggered by the page loading.
    Visit my blog
    PHP && Life
    for technology articles and musings.

  5. #5
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    let me try one of...

  6. #6
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most linux servers don't have a display manager installed and won't be able to do this.

  7. #7
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by roosevelt View Post
    The basic idea is to make it like this:

    1) Install a browser in the server.

    2) Using commands run the browser, open up the URL, use Perl script to take screenshots.

    I don't know the exact codes but to save time you could just this the following services:

    http://images.websnapr.com/?url=yourdomain.com&size=t
    http://www.webshotspro.com/
    http://www.thumbalizr.com/

    Basically use them to generate the thumbnail and do get_file_contents() to get the thumbnail .

    Here's something you can use in your own server:

    http://hasin.wordpress.com/2006/09/0...age-using-php/
    I tried most of them but non of them can be used some are quite near but most of them have some problem

    http://images.websnapr.com/?url=yourdomain.com&size=t

    is there something like this
    i don't know what is wrong with this i tried it but there is some problem in generating the image.

  8. #8
    I Never Give Up roosevelt's Avatar
    Join Date
    May 2005
    Posts
    515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    http://images.websnapr.com/?url=yourdomain.com&size=l seems to be working fine. I just changed the size to l (large).

    When you visit the URL it doesn't generate the thumbnail right away, but second time it does.

  9. #9
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks it seems like it is working

  10. #10
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use w3snapshot.com for this.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •