Created
April 11, 2016 20:03
-
-
Save gkbrk/b014851043fa4a8e472bbd01ecf2bad9 to your computer and use it in GitHub Desktop.
Serie tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Tiny; | |
sub http_get { | |
my $http = HTTP::Tiny->new; | |
return $http->get($_[0])->{content}; | |
} | |
my @series; | |
my $html = http_get "http://dizimag.co/"; | |
while ($html =~ /alt="(.*) (.*)\. Sezon (.*)\. Bölüm" class="avatar" width=40\>/g) { | |
push(@series, $1." Season ".$2." Episode ".$3); | |
} | |
my @favorites = ("arrow", "flash", "legends of tommorrow", "grimm", "limitless", | |
"izombie", "magicians", "person of interest", "daredevil"); | |
foreach my $episode (@series) { | |
print "\033[0m"; # white | |
foreach my $fav (@favorites) { | |
if ($episode =~ /$fav/i) { | |
print "\033[93m"; # yellow | |
print "---> "; | |
last; | |
} | |
} | |
print $episode, "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment