Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url='http://sistemasenem2.inep.gov.br/resultadosenem/';
- x=urlread(url);
- count=0;
- dlgflag=0;
- stime=now;
- fprintf('Hora de Início: %s\n',datestr(rem(now,1),'HH:MM:SS'));
- while(true)
- prev=x;
- [x,status]=urlread(url);
- if status
- if ~strcmp(x,prev)
- fprintf(2,'Modificação detectada! %u, %s, %s\n',count,datestr(rem(now-stime,1),'HH:MM:SS'), datestr(rem(now,1),'HH:MM:SS'));
- if ~dlgrflag
- warndlg(['Modificação no website detectada! Hora:' datestr(rem(now,1),' HH:MM:SS')]);
- web(url,'-browser')
- end
- count=count+1;
- dlgrflag=1;
- else
- fprintf('Sem modificação... %u, %s\n',count,datestr(rem(now-stime,1),'HH:MM:SS'));
- count=count+1;
- dlgeflag=0;
- dlgrflag=0;
- end
- else
- fprintf(2,'Um erro ocorreu! %u, %s, %s\n',count,datestr(rem(now-stime,1),'HH:MM:SS'), datestr(rem(now,1),'HH:MM:SS'));
- if ~dlgeflag
- errordlg(['Um erro ocorreu! Hora:' datestr(rem(now,1),' HH:MM:SS')])
- end
- dlgeflag=1;
- count=count+1;
- x=prev;
- end
- pause(15);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement