23 lines
483 B
Perl
23 lines
483 B
Perl
|
#!/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));
|