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


