#include<stdio.h>
#include<stdlib.h>
#include<string.h>
()
{
FILE *pfile1;
int i,j;
i=1;
j=0;
char flag[3];
strcpy(flag,"");

while (i>0)
{
system("wget -p http://www.cs.rmit.edu./students/");
pfile1=fopen(" ./www.cs.rmit.edu./.txt","w");

system("mkdir ");


system("md5sum ./www.cs.rmit.edu./images/*.* > ./www.cs.rmit.edu./.txt ");


fclose(pfile1);


if (strcmp(flag,"yes")!=0)
{

system(" mv ./www.cs.rmit.edu./.txt ./.txt");
system(" cp ./www.cs.rmit.edu./students/index.html ./");

}


if (strcmp(flag,"yes")==0)
{


system("diff  ./www.cs.rmit.edu./students/index.html  .//index.html | mail @cs.rmit.edu. ");
system("diff  ./www.cs.rmit.edu./.txt  ./.txt | mail @cs.rmit.edu. ");

system(" mv ./www.cs.rmit.edu./.txt ./.txt");

}

sleep(86400);
j++;
strcpy(flag,"yes");
}

}

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <strings.h>
#include <ctype.h>

int ()
{
  FILE *fp; 
  char *chk,[4];
  int i=1;
  while (i == 1) 
  {
  
  system("wget -p --convert-links http://www.cs.rmit.edu./students/");

  system("mkdir first"); 
  system("mkdir second"); 

  
  system("mv www.cs.rmit.edu./images/*.*  first/");
  system("mv www.cs.rmit.edu./students/*.* first/");

  sleep(86400); 

  
  system("wget -p --convert-links http://www.cs.rmit.edu./students/");

  
  system("mv www.cs.rmit.edu./images/*.* second/");
  system("mv www.cs.rmit.edu./students/*.* second/");

  
  
  system("diff first second > imagesdifference.txt");

  
  fp = fopen("imagesdifference.txt","r");
  
  chk = fgets(, 4, fp);
  
  if (strlen() != 0)
     system("mailx -s  \"Difference from WatchDog\"  < imagesdifference.txt");
  }
  return 0;
}
