Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: URL Snapshot

  1. #1
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts

    URL Snapshot

    Anyone know`how to create a snapshot of a url using the image functions?
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you mean like using cURL or so to request an url and then create an image that shows how the url would be rendered by a browser?

    i don't think this is possible with only PHP. You'll need an extra soft to render the html (browser) and probably some extra soft (like SnagIT or so) to take the snapshot.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Feb 2006
    Location
    Germany
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @raf: I'm not sure if it really is impossible...

    If you think about it.. php should be able to contact a target website over port 80 and receive the same source that a visitor would .. and PHP has the GD Libary to create images. And you could probably try and take the rendering engine of a browser to parse the html...

    It would be complicated and not easy, that is sure, but I doubt that it is impossible. Especially if you have direct server access, as you can execute files over php..

    That is all theory though so don't ask me for details.

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you're not realy giving any real hint to a sollution...

    like i said, you need so soft to, render the code (which you comfirm) and then you'll need some soft to take the snapshot (which you wanna do using the GD Library --> how exactly would that be done?).
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #5
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    @Raf I am referring to the second of your comments
    Quote Originally Posted by raf
    to request an url and then create an image that shows how the url would be rendered by a browser?
    Don't rack your brains about it. It was more of a "I wonder how" type of thing. Anyone know what they do on Alexa.com? Like if you were to type in a website name it shows you a thumbnail of that site. I did this the other day on a site I used to work for and it had a snapshot of alteast 2 years ago up. Just wondering on the technology used. I didn't/don't think they manually do this.....would they? How much am I over thinking this?
    Last edited by StupidRalph; 02-17-2006 at 03:57 AM.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #6
    Regular Coder goughy000's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    415
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could just take it off Alexa.com....

    Code:
    <img src="http://pthumbnails.alexa.com/image_server.cgi?id=yoursite.com&size=large&url=http://google.com">
    Would give a thumbnail of google's homepage

  • #7
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    from here:
    http://www.webmasterworld.com/forum13/3747.htm
    One way you can do it is you have a browser such as mozilla installed on the server, and you also have X running (and a window manager), you can get a screenshot this way:

    Leave the browser window open, fully maximized, in your server's X session. Run the command (from your script):

    mozilla -remote openURL('http://www.mysite.com')

    This should open the URL up in the servers X session. Once that is done, take a screen shot with any of the available tools for X. We'll use xwd as an example:

    xwd -frame -root -out myscreenshot.xwd

    This will take a full screenshot of the X root window, which should have the browser window open at that URL.

    After that, you may have to use ImageMagick or NetPBM to convert the file into something usable for the web.

    Hope this helps, even if it just points you in the right direction.
    sounds fun


  •  

    Posting Permissions

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