Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created January 4, 2017 23:03
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 zoffixznet/a3790ddfec6e1c544bf766b23e3caefd to your computer and use it in GitHub Desktop.
Save zoffixznet/a3790ddfec6e1c544bf766b23e3caefd to your computer and use it in GitHub Desktop.
#!/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