tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,10 @@
|
|||
use LWP::Simple;
|
||||
|
||||
my $site = "http://rosettacode.org";
|
||||
my $list_url = "/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
|
||||
|
||||
for (get("$site$list_url") =~ /cm.*?title="(.*?)"/g) {
|
||||
(my $slug = $_) =~ tr/ /_/;
|
||||
my $count = () = get("$site/wiki/$slug") =~ /toclevel-1/g;
|
||||
print "$_: $count examples\n";
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
use v5.10;
|
||||
use Mojo::UserAgent;
|
||||
|
||||
my $site = "http://rosettacode.org";
|
||||
my $list_url = "/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
|
||||
|
||||
my $ua = Mojo::UserAgent->new;
|
||||
$ua->get("$site$list_url")->res->dom->find('cm')->each(sub {
|
||||
(my $slug = $_->{title}) =~ tr/ /_/;
|
||||
my $count = $ua->get("$site/wiki/$slug")->res->dom->find("#toc .toclevel-1")->size;
|
||||
say "$_->{title}: $count examples";
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue