t/data/autodiscover/fix_uri
raw| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use strict; |
| 4 | use warnings; |
| 5 | use feature 'say'; |
| 6 | |
| 7 | use File::Slurp; |
| 8 | |
| 9 | sub fix_one { |
| 10 | my ($file) = @_; |
| 11 | |
| 12 | my $html = read_file $file; |
| 13 | |
| 14 | $html =~ s|https://web.archive.org/web/\d+/http://www.ragingplatypus.com|http://example.com|g; |
| 15 | |
| 16 | write_file($file, $html); |
| 17 | } |
| 18 | |
| 19 | for (@ARGV) { |
| 20 | say $_; |
| 21 | fix_one($_); |
| 22 | } |