

             
	     


#include<stdio.h>
#include<stdlib.h>
#include<string.h>

    
    int  ()
    {
       char url[30];
       int exitValue=-1;
       FILE *fr;

       char s[300]; 	     
	system("rm index.html*");
        system("wget http://www.cs.rmit.edu./students/ ");    
	 system("mv index.html one.html");
	 
           printf("System completed Writing\n"); 
	   system("sleep 3600");
	    
	    
            system("wget http://www.cs.rmit.edu./students/ "); 
            
	          
	    	     
	     exitValue=system("diff one.html index.html > .out" );
	     
             fr=fopen(".out","r");
	     
	     strcpy(s,"mailx -s \"Testing Again\"");
	     	     
	     strcat(s,"  < .out");
	     if(fgets(url,30,fr))
	     {
	     system(s);
	     
	     system("rm one.html");  
	     
	     printf("\nCheck your mail") ; 
	     fclose(fr);        
	     }
	       else
	           {
	            printf(" changes detected"); 
		    
	            system("rm one.html"); 
		    fclose(fr);   
		   }
		   return 0;   
      }
      
      
   




#include<stdio.h>
#include<stdlib.h>
#include<strings.h>
#include<ctype.h>

int ()
{

 FILE *fp;
 char [100];
 int flag = 0;
 system("rm index.html*");
 system("wget http://www.cs.rmit.edu./students/");
 system("wget -p --convert-links http://www.cs.rmit.edu./students/");
 system("mv index.html index1.html");
 sleep(8640);
 system("wget http://www.cs.rmit.edu./students/");
 system("wget -p --convert-links http://www.cs.rmit.edu./students/");

 system("diff index1.html index.html > out.txt");

 fp = fopen("out.txt","r");

 if (fgets(,100,fp) != NULL)
 {

   flag = 1;
   printf("\nThere  changes in the website.Check your mail\n");
   system("mailx -s \"output of watchdog\"  < out.txt");

 }

  if(flag == 0 )
   printf("\n    changes in the website\n ");
 fclose(fp);
 exit(1);

 }














