uBlacklistFandomWikis/generate.pl

23 lines
483 B
Perl
Raw Normal View History

2023-07-05 19:56:25 +00:00
#!/bin/env perl
use warnings;
use strict;
use utf8;
use YAML::Syck;
use File::Slurp;
use Sort::Key::Natural qw(natsort);
my $data = LoadFile('list.yml');
my @list;
foreach my $wiki ( keys %{$data} ) {
foreach my $lang ( @{%{$data}{$wiki}} ) {
if ($lang eq 'en') {
push(@list, "*://" . $wiki . ".fandom.com/wiki/*\n")
} else {
push(@list, "*://" . $wiki . ".fandom.com/" . $lang . "/wiki/*\n")
}
}
}
write_file('ublacklist-fandom.txt', natsort(@list));