Skip to content

Instantly share code, notes, and snippets.

@tirkarthi
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirkarthi/e28f62eb562db5037634 to your computer and use it in GitHub Desktop.
Save tirkarthi/e28f62eb562db5037634 to your computer and use it in GitHub Desktop.
Perl script for World cup
#!/usr/bin/perl
use strict;
use warnings;
while (1) {
`wget --no-proxy --quiet http://static.cricinfo.com/rss/livescores.xml -O score.txt`;
sleep(10); # Set to seconds
my $text = `cat score.txt`;
$text =~ m!<title>(.*India.*)</title>!;
my $score = $1;
$score = '"'.$score.'"';
`notify-send -t 500 $score`; # T the time to expire the notification. currently 500 milliseconds.
}
# The bubble stays because its a bug irrespective of the expire time flag
# sadly no overs or player info at the moment :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment