

#include "stdio.h"
#include "stdlib.h"


int getDifference()
{
	system("wget http://www.cs.rmit.edu./students/");
	return system("diff index.html index.html.1");
}


int sendMail()
{
	int ret;
	printf("\n Program has Detected a Change  the webpage, a mail has been send    yallara .\n");
	ret = system("diff index.html index.html.1 | mail @cs.rmit.edu.");
	sleep(1000);
	system("clear");
}

void clean()
{
	system("rm index.htm*.*");
}
()
{
	while(1){

	int ret = 0;
	ret = getDifference();
	if(ret>0)
	{
	sendMail();
	}
else
	{
	printf("\n  is  difference in the web \n");
	}
	clean();
	printf("Checking the  every 24 hrs..");

	sleep(86400000);
	}
}










#include <stdio.h>	
#include <sys/time.h>

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



int () 
	{
	 FILE *fileopen;
  
	char *t_tst,chk[6]; 
    
	system("wget -p --convert-links http://www.cs.rmit.edu./students/");
	
  
	system("mkdir original");

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

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

	sleep(75);

	system("wget -p --convert-links http://www.cs.rmit.edu./students/");
  
	system("mkdir two");
  
	system("mv www.cs.rmit.edu./images/*.* fresh/");

	system("mv www.cs.rmit.edu./students/*.* fresh/");
  
	system("diff one two > image_dif.txt");
  
	fileopen = fopen("imagedif.txt","r");
	t_tst = fgets(chk, 6, fileopen);
  
	if (strlen(chk) != 0)
     
	  system("mailx -s  \" WatchDog program has observed some Differences \" @.rmit.edu. < image_dif.txt");
	
		return 0;
	
}











