Created
January 4, 2017 23:03
-
-
Save zoffixznet/a3790ddfec6e1c544bf766b23e3caefd to your computer and use it in GitHub Desktop.
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 5.024; | |
use WWW::Mechanize; | |
my $mech = WWW::Mechanize->new(autocheck => 0); | |
$mech->get('http://perl6.fail'); | |
my @RTs = $mech->find_all_links( text_regex => qr/^RT/ ); | |
my @tests; | |
my @with_tests; | |
for (@RTs) { | |
$mech->get($_->url); | |
unless ( $mech->success ) { | |
warn "Failed to fetch " . $_->url . ": " . $mech->res->status_line; | |
next; | |
} | |
if ( | |
$mech->content( format => 'text' ) | |
=~ /\btest.*need|\bneed.*test\b/i | |
) { | |
say $_->url . " is a candidate"; | |
push @with_tests, $_->url; | |
} | |
} | |
say "------------------"; | |
say for @with_tests; | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment