Created
February 15, 2014 16:35
-
-
Save kyleskrinak/9021709 to your computer and use it in GitHub Desktop.
Perl script to check a dynamically-generated web site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use constant SITEMAP => "http://v.box:10144/sitemap.xml"; | |
use constant MAX_PAGES => 10; | |
$npages = 0; | |
for (qx{curl --silent @{[SITEMAP]}}) { | |
m{<loc>(.*?)</loc>} or next; | |
$page = $1; | |
++$npages > MAX_PAGES and last; | |
print "$page\t"; # here so if aspell crashes, we know which page | |
$typos = qx{curl --silent $page | aspell --mode=html --home-dir=. --personal=dict.txt list}; | |
$typos =~ tr{\n}{ }; | |
print "$typos\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from drupal.stackexchange I made some mac-specific updates. Of course, you'll need aspell, curl and xmlsitemap to automatically generate the pages you wish to check