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') {
|
2023-07-06 05:20:43 +00:00
|
|
|
push @list, "*://" . $wiki . ".fandom.com/wiki/*\n"
|
|
|
|
} elsif ($lang eq '*') {
|
|
|
|
push @list, "*://" . $wiki . ".fandom.com/wiki/*\n";
|
|
|
|
push @list, "*://" . $wiki . ".fandom.com/*/wiki/*\n"
|
2023-07-05 19:56:25 +00:00
|
|
|
} else {
|
2023-07-06 05:20:43 +00:00
|
|
|
push @list, "*://" . $wiki . ".fandom.com/" . $lang . "/wiki/*\n"
|
2023-07-05 19:56:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
write_file('ublacklist-fandom.txt', natsort(@list));
|