broken-link-checker
broken-link-checker copied to clipboard
Check a list of links
Is there an option to check a list of links (not recursively)?
Programmatic API: blc.UrlChecker
for single links or blc.HtmlUrlChecker
for a page with shallow/non-recursive links.
CLI: is not recursive by default and will check only the links on a single page
@stevenvachon I mean, for CLI can I pass the list of links to blc
or I should create a simple bash script for that?
The CLI is currently for checking links within pages only.
Sorry for misleading you, I mean list of pages also. Is that possible?
The CLI currently only supports one URL input. A PR is welcome.
This has been implemented in the v0.8 branch.
Hi @stevenvachon , this would be a great feature, Thank you! From the commits it seems that this is still work in progress, correct?
@Andrea-borg v0.8.0 has not yet been released. The feature works in that pre-release, though.
Oh that's great, Thank you @stevenvachon May you please give an example of how this argument should be passed in the command line please? Something like this maybe? : node bin/blc file://urls.txt
file://
is not yet working in that branch.
blc http://site1/ http://site2/
@Andrea-borg I use a simple bash script that reads links from the file line by line:
#!/bin/bash
FILE=links.txt
while read CMD; do
echo "$CMD"
blc "$CMD"
done < "$FILE"
Thank you @vkotovv :)
@Andrea-borg, another solution:
const shell = require('shelljs');
const urls = ['https://ukr.net', 'https://meta.ua'];
urls.forEach((el) => {
shell.exec(`npx blc ${el} -reo`);
});