

             
	     


#include<stdio.h>
#include<stdlib.h>
#include<string.h>

    
    int  ()
    {
       char url[30];
       int exitValue=-1;
       FILE *fr;

       char s[300]; 	     
	system("rm index.html*");
        system("wget http://www.cs.rmit.edu./students/ ");    
	 system("mv index.html one.html");
	 
           printf("System completed Writing\n"); 
	   system("sleep 3600");
	    
	    
            system("wget http://www.cs.rmit.edu./students/ "); 
            
	          
	    	     
	     exitValue=system("diff one.html index.html > .out" );
	     
             fr=fopen(".out","r");
	     
	     strcpy(s,"mailx -s \"Testing Again\"");
	     	     
	     strcat(s,"  < .out");
	     if(fgets(url,30,fr))
	     {
	     system(s);
	     
	     system("rm one.html");  
	     
	     printf("\nCheck your mail") ; 
	     fclose(fr);        
	     }
	       else
	           {
	            printf(" changes detected"); 
		    
	            system("rm one.html"); 
		    fclose(fr);   
		   }
		   return 0;   
      }
      
      
   




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


int ()
{
	
	FILE* fpp;										
	FILE* fp;
			
	char s[100];
	int i;
	
	while(1)										
	{
		system("wget -nv http://www.cs.rmit.edu./students");				
		
		i=0;		
		
		fp = fopen("dummyindex.txt","r");
		
		if(fp == (FILE*) NULL)								
		{
			printf(" is  previously saved webpage in the file\n");
			i=1;
			fp = fopen("dummyindex.txt","w");

		}
				
		fclose(fp);
		
				
		
		
		
		system("diff index.html dummyindex.txt > compareoutput.txt");		

				
		if(fpp != (FILE*) NULL)	
		{
			
			fpp = fopen("compareoutput.txt","r");					
			
			fgets(s,100,fpp);							
			
			fclose(fpp);								
		
		
		   
			if((strlen(s)>0) && i==0)								
			{
				system("mail @cs.rmit.edu. < compareoutput.txt");	
				system("cp index.html dummyindex.txt");				
				printf("Message has been sent\n");				
			}
			else
				printf(" is  change in the \n");			
		}
		
		

		system("rm index.html")	;				
		
		sleep(86400);									
	}
				
	return 1;
}
