Results 1 to 8 of 8

Program to detect changes in a site....

This is a discussion on Program to detect changes in a site.... within the Off Topic forums, part of the Entertainment category; I need a program to refresh a webpage and only stop refreshing when there are changes to the website. Need ...
Page: 1


  1. #1
    Banned Senior Member
    Join Date
    Mar 2006
    Location
    Kanata eh?
    Posts
    7,163

    Default

    I need a program to refresh a webpage and only stop refreshing when there are changes to the website. Need to get into a beta but the site doesn't have any registration yet just "watch this page etc". Either a FF plugin or actual program would work ^^

  2. #2
    Protoss Arbiter Senior Member
    Join Date
    Mar 2006
    Location
    California
    Posts
    2,296

    Default

    I need a program to refresh a webpage and only stop refreshing when there are changes to the website. Need to get into a beta but the site doesn't have any registration yet just "watch this page etc". Either a FF plugin or actual program would work ^^[/b]
    Code:
    <?php
    
    /*
    Detect Site Changes
    Author: Allen S. Chen
    Written: Friday, March 09, 2007
    Last Saved: 2:41 PM
    */
    
    $URL = &#39;INSERT THE URL HERE&#39;;
    
    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;r&#39;);
    $read_file = fread($file_open, 99999);
    fclose($file_open); //saving resources
    
    //If the website has ads on it, and it&#39;s written in server-side dynamic scripting, the AD code may change.**So to prevent this, do an explode(); wherever necessary, or do a preg_match_all()
    
    //Save the File md5() hash to speed up comparison
    $read_file_md5 = md5($read_file);
    
    //Open the file you need
    $file_source = view_source($URL);
    $file_source_md5 = md5($file_source);
    
    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;w&#39;);
    $read_file = fwrite($file_open, $file_source);
    fclose($file_open); //saving resources
    
    //Compare the source
    
    if ($read_file_md5 == $file_source_md5) {
    //No changes to the site made.
    echo "<meta http-equiv=&#39;refresh&#39; content=&#39;5; url=" . $_SERVER[&#39;PHP_SELF&#39;] . "&#39;>";
    echo &#39;No changes detected to the website.&#39;;
    } else {
    //Insert code here that you want to alert you.**To do a bell, uncomment the line below.**Of course, you&#39;d have to add telephone.wav to your server.
    //echo &#39;<EMBED SRC="telephone.wav" LOOP=TRUE AUTOSTART="TRUE" HIDDEN="TRUE">&#39;;
    echo &#39;Change detected in the website.&#39;;
    }
    
    ?>

  3. #3
    Senior Member festo's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    2,820

    Default

    [codebox]?php

    /*
    Detect Site Changes
    Author: Nick Sylvester
    Written: Friday, March 09, 2007
    Last Saved: 1:41 PM
    */

    $url = &#39;INSERT THE URL HERE&#39;;

    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;r&#39;
    $read_file = fread($file_open, 99999);
    fclose($file_open); //saving resources

    //If the website has ads on it, and it&#39;s written in server-side dynamic scripting, the AD code may change. So to prevent this, do an explode(); wherever necessary, or do a preg_match_all()

    //Save the File md5() hash to speed up comparison
    $read_file_md5 = md5($read_file);

    //Open the file you need
    $file_source = view_source($URL);
    $file_source_md5 = md5($file_source);

    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;w&#39;
    $read_file = fwrite($file_open, $file_source);
    fclose($file_open); //saving resources

    //Compare the source

    if ($read_file_md5 == $file_source_md5) {
    //No changes to the site made.
    echo "<meta http-equiv=&#39;refresh&#39; content=&#39;5; url=" . $_SERVER[&#39;PHP_SELF&#39;] . "&#39;>";
    echo &#39;No changes detected to the website.&#39;;
    } else {
    //Insert code here that you want to alert you. To do a bell, uncomment the line below. Of course, you&#39;d have to add telephone.wav to your server.
    //echo &#39;<EMBED SRC="telephone.wav" LOOP=TRUE AUTOSTART="TRUE" HIDDEN="TRUE">&#39;;
    echo &#39;Change detected in the website.&#39;;
    }

    ?>[/codebox]

  4. #4
    Protoss Arbiter Senior Member
    Join Date
    Mar 2006
    Location
    California
    Posts
    2,296

    Default

    [codebox]?php

    /*
    Detect Site Changes
    Author: Nick Sylvester
    Written: Friday, March 09, 2007
    Last Saved: 1:41 PM
    */

    $url = &#39;INSERT THE URL HERE&#39;;

    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;r&#39;
    $read_file = fread($file_open, 99999);
    fclose($file_open); //saving resources

    //If the website has ads on it, and it&#39;s written in server-side dynamic scripting, the AD code may change. So to prevent this, do an explode(); wherever necessary, or do a preg_match_all()

    //Save the File md5() hash to speed up comparison
    $read_file_md5 = md5($read_file);

    //Open the file you need
    $file_source = view_source($URL);
    $file_source_md5 = md5($file_source);

    $file_open = fopen(&#39;cache_file.txt&#39;, &#39;w&#39;
    $read_file = fwrite($file_open, $file_source);
    fclose($file_open); //saving resources

    //Compare the source

    if ($read_file_md5 == $file_source_md5) {
    //No changes to the site made.
    echo "<meta http-equiv=&#39;refresh&#39; content=&#39;5; url=" . $_SERVER[&#39;PHP_SELF&#39;] . "&#39;>";
    echo &#39;No changes detected to the website.&#39;;
    } else {
    //Insert code here that you want to alert you. To do a bell, uncomment the line below. Of course, you&#39;d have to add telephone.wav to your server.
    //echo &#39;<EMBED SRC="telephone.wav" LOOP=TRUE AUTOSTART="TRUE" HIDDEN="TRUE">&#39;;
    echo &#39;Change detected in the website.&#39;;
    }

    ?>[/codebox][/b]
    ._.

  5. #5
    Banned Senior Member
    Join Date
    Mar 2006
    Location
    Kanata eh?
    Posts
    7,163

    Default

    ya... I figured I&#39;d ask you about a php script for it lutz but i&#39;ll prob need to explaining about it later tonight

  6. #6
    Senior Member Arca_'s Avatar
    Join Date
    Mar 2006
    Location
    Brussels - Belgium
    Posts
    1,661

    Default

    hey is it normal that I DONT UNDERSTAND A SINGLE WORD IN THE CODES ?????

  7. #7
    DisillusionedIdealogue
    Guest

    Default

    hey is it normal that I DONT UNDERSTAND A SINGLE WORD IN THE CODES ?????[/b]
    no, its all in english :huh: . lol :lol:

  8. #8
    Banned Senior Member
    Join Date
    Mar 2006
    Location
    Kanata eh?
    Posts
    7,163

    Default

    Does anyone who knows php know how to fill in the blanks in that script then or tell me how to run it -_- Lutz is being gay

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
  •