SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Taking snapshot using PHP

    I want take a snap shot of any website dynamically using PHP. Is it possible in PHP? If possible then would you like to tell me the steps?

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum. See Where should I post my thread? for details

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    CA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are programs for this, check out google, but you can do this with php.

    The general steps should look like this:

    - Get the pages starting from a page, like homepage. using curl

    - Parse the html file. Parse all the links. Check out PEAR for parsing HTML pages. There are couple of classes to parse HTML pages there.

    - Start visiting and parsing links from each link at the homepage. Remember the links you have visited. While you visit those pages and retrieve the files, to take a "snapshot" you need to change the links so that you can view pages locally. i.e. change /css/site.css into ../css/site.css for the pages one level down the root level.

    It is quite tricky to do all of these, so I would recommend to take a look at the existing programs which solve this problem.


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
  •