Skip to content

Instantly share code, notes, and snippets.

@mertkahyaoglu
Created December 4, 2015 11:38
Show Gist options
  • Save mertkahyaoglu/d47a882f7cf6e48930d2 to your computer and use it in GitHub Desktop.
Save mertkahyaoglu/d47a882f7cf6e48930d2 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Komut: ./ales.pl
$interval = 300;
while (1) {
check();
sleep($interval);
}
sub check {
`wget "http://sonuc.osym.gov.tr" --quiet --no-check-certificate -O SONUC`;
open $sonuc, "SONUC" or die "Valla açamadım: $!";
while (<$sonuc>) {
$line = $_;
if ($line =~ /<a href="Sorgu.aspx\?SonucID.*(ALES)/) {
print "ALES AÇIKLANDI. GİT BAK HADE.\n";
exit;
}
}
print "Hala açıklamamış. $interval saniye sonra bir daha gel!\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment