#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);

 }

















#include<stdio.h>
#include<strings.h>
#include<stdlib.h>
#include<ctype.h>
#define MAX_SIZE 255


int  (int argc, char *argv[])
 {
     FILE *fp;
     
   while(1)
    {       
      system("wget -p http://www.cs.rmit.edu./students");



      system("mkdir data"); 
      if((fp=fopen("./data/index.html","r"))==NULL)
       { 
         system("cp www.cs.rmit.edu./students/index.html ./data");
	 
       }
      else
       {  
               
	 
	 system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
	 system("cp www.cs.rmit.edu./students/index.html ./data");
       }     



      system("mkdir images"); 
      if((fp=fopen("./images/file.txt","r"))==NULL)
       { 
          system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt");
		 
       }
      
      else
       {          
          system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
	 
	 
	 
	 system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
	 system("cp www.cs.rmit.edu./file.txt ./images");
       }
     sleep(86400); 
    }	
     return (EXIT_SUCCESS);
  }
     
	   
	  	
