Mobile Optimised Website W3C Link Checker
This post is about link checking your mobile optimised site to W3C standard.W3C are a standards body who provides free link checking software, which can be run from their website. Link checking is a great way of improving a site’s quality and it can be done automatically! But where’s the support for mobile? I found it hard to run any link checkers whilst developing our mobile optimized site, so I tweaked the existing W3C link checker…
W3C Link Checker for Mobile
Finding no mobile link checkers I extended the W3C link checker to do the job. For security reasons you should go to the official site and alter the Perl script manually, but for the trusting the edited script can be downloaded here (I’ve also removed the 1 page per second limit).
To extend checklink for mobile user agents, add a new line to line 1307 of the checklink code containing:
$request->header('User-Agent', 'Mobile');
To run this link checker across your entire site you’ll need to run it recursively (using -r), I run the script using (For -S0 to work you’ll need to alter the script again):
checklink-m -Hbrq -S0 http://stripeylines.com > release-12.2.m.html
Future Work
Ideally, the checklink script would be extended and the user-agent passes as a parameter (permitting both PC and mobile site checking). If anyone wishes to take this further I’d be interested in the end result. If I have no responses in the following weeks I’ll contact W3C with my suggestions.