https://github.com/dbogatov/broken-links-inspector

Extract and recursively check all URLs reporting broken ones

https://github.com/dbogatov/broken-links-inspector

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, scholar.google, acm.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Extract and recursively check all URLs reporting broken ones

Basic Info
  • Host: GitHub
  • Owner: dbogatov
  • License: mit
  • Language: TypeScript
  • Default Branch: master
  • Size: 646 KB
Statistics
  • Stars: 8
  • Watchers: 4
  • Forks: 0
  • Open Issues: 6
  • Releases: 0
Created about 6 years ago · Last pushed over 3 years ago
Metadata Files
Readme License

README.md

Broken Links Inspector

NPM pipeline status coverage report

This project is heavily inspired by stevenvachon/broken-link-checker.

If you want to use this tool and need any help (instructions, bug fixes, features) open an issue!

Features: - inspects a web-page and all its URLs, reports broken ones - can go recursively, inspecting all pages within a domain - makes requests in parallel, shows indication of "work in progress" - does not check URL twice - reports OK, TIMEOUT, ERROR CODE or generic error - support configurable timeout - supports GET and HEAD methods (double checks with GET if HEAD fails) - supports a list of excluded URLs (glob matching) and/or excluded prefixes (e.g. mailto:) - can define OK codes, such as 999 for linkedin - supports different reporting, such as colored console or JUnit file - JUnit report is best used with CI (tested with GitLab) - need a feature, go to issues

How to install and run

``` npm i -g broken-links-inspector

bli inspect https://dbogatov.org -r -t 2000 -s linkedin --reporters console

or

bli inspect file://links.txt

with a URL per line in a file links.txt

```

See output ``` ................................................................................ ................................................................................ ........................ original request OK : https://dbogatov.org/ OK: 1, skipped: 0, broken: 0 https://dbogatov.org/ OK : https://scholar.google.com/citations?user=Mq8ButkAAAAJ OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/resume.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/cv.pdf OK : https://twitter.com/Dima4ka007 OK : https://d3g9eenuvjhozt.cloudfront.net/assets/vendor/css/merged.css OK : https://d3g9eenuvjhozt.cloudfront.net/assets/vendor/js/merged.js OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/dmytro-bogatov.jpg OK : https://dbogatov.org/contact OK : https://dbogatov.org/research OK : https://d3g9eenuvjhozt.cloudfront.net/assets/favicon.ico OK : https://dbogatov.org/publications OK : https://www.googletagmanager.com/gtag/js?id=UA-65293382-4 OK : https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css OK : https://git.dbogatov.org/dbogatov/research-website/commit/39ecd1a9 OK : https://dbogatov.org/projects OK : https://www.facebook.com/dkbogatov OK : https://dbogatov.org/education OK : https://github.com/dbogatov OK: 18, skipped: 3, broken: 0 https://dbogatov.org/education OK : https://d3g9eenuvjhozt.cloudfront.net/assets/config/grades.yml OK: 1, skipped: 21, broken: 0 https://dbogatov.org/projects OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/mandelbrot.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/matters-proj.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/shevastream.png OK : https://github.com/WPIMHTC OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/status-site.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/bu-logo.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/projects/fabric.png OK : https://github.com/dbogatov/shevastream OK : https://legacy.dbogatov.org/Project/Mandelbrot OK : https://github.com/dbogatov/legacy-website OK : https://github.com/IBM/dac-lib OK : https://github.com/dbogatov/status-site OK : https://github.com/dbogatov/ore-benchmark OK : https://shevastream.com/ OK : https://status.dbogatov.org/ OK : https://ore.dbogatov.org/ OK : http://matters.mhtc.org/ OK : https://dbogatov.org/assets/docs/dac-fabric.pdf OK: 18, skipped: 21, broken: 0 https://dbogatov.org/publications OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/mqp-paper.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/econ-paper.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/ore-presentation.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/ore-poster.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/ore-benchmark.pdf OK : http://dispot.korkinlab.org/ OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/dac-fabric.pdf OK : https://d3g9eenuvjhozt.cloudfront.net/assets/docs/dispot.pdf OK : https://hub.docker.com/r/korkinlab/dispot OK : https://github.com/korkinlab/dispot OK : https://digitalcommons.wpi.edu/cgi/viewcontent.cgi?article=2915&context=iqp-all OK : https://dl.acm.org/doi/10.14778/3324301.3324309 OK : https://doi.org/10.14778/3324301.3324309 OK : https://doi.org/10.1093/bioinformatics/btz587 OK : https://academic.oup.com/bioinformatics/article/35/24/5374/5539863 OK: 15, skipped: 21, broken: 0 https://dbogatov.org/research OK : http://people.cs.georgetown.edu/~kobbi/ OK : https://arxiv.org/abs/1706.01552 OK : https://www.cs.bu.edu/~reyzin/ OK : http://www.cs.bu.edu/~gkollios/ OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/bjoern.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/kobi.jpg OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/kellaris.jpeg OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/lorenzo.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/leo.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/adam.jpg OK : http://www.cs.bu.edu/fac/gkollios/ OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/kollios.png OK : https://d3g9eenuvjhozt.cloudfront.net/assets/img/collaborators/pixel.jpg OK : https://www.icloud.com/sharedalbum/ OK : https://www.cics.umass.edu/people/oneill-adam OK : https://computerscience.uchicago.edu/people/profile/lorenzo-orecchia/ OK : https://midas.bu.edu/ OK : https://dblp.org/pers/t/Tackmann:Bj=ouml=rn.html OK : https://dbogatov.org/assets/docs/ore-benchmark.pdf OK : https://dbogatov.org/assets/docs/dac-fabric.pdf OK: 20, skipped: 22, broken: 0 https://dbogatov.org/contact OK: 0, skipped: 23, broken: 0 OK: 73, skipped: 111, broken: 0 ```

How to use

``` $ bli inspect -h

Usage: index inspect [options] file://

Check links in the given URL or a text file

Options: -r, --recursive recursively check all links in all URLs within supplied host (ignored for file://) (default: false) -t, --timeout timeout in ms after which the link will be considered broken (default: 2000) -g, --get use GET request instead of HEAD (default: false) -s, --skip URLs to skip defined by globs, like 'linkedin' (default: []) --reporters Reporters to use in processing the results (junit, console) (default: ["console"]) --retries The number of times to retry TIMEOUT URLs (default: 3) --user-agent The User-Agent header (default: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10157) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15") --ignore-prefixes prefix(es) to ignore (without ':'), like mailto: and tel: (default: ["javascript","data","mailto","sms","tel","geo"]) --accept-codes HTTP response code(s) (beyond 200-299) to accept, like 999 for linkedin (default: [999]) --ignore-skipped Do not report skipped URLs (default: false) --single-threaded Do not enable parallelization (default: false) -v, --verbose log progress of checking URLs (default: false) -h, --help display help for command ```

Return code is 1 if at least one broken link detected, 0 otherwise.

-r, --recursive will instruct inspector to keep checking all URLs in the original domain. Very useful for checking an entire website, such as personal blog. For example, bli inspect https://yoursite.com -r will check yoursite.com and if it finds something like yoursite.com/contact it will check that as well and will keep going. It will check all URLs on all pages, but will not parse "external" pages.

-t, --timeout <number> given in milliseconds sets a timeout for a request. If this timeout is exceeded, the check fails with TIMEOUT.

-g, --get instructs to use GET request instead fo the default HEAD request. If HEAD request fails, the URL will be retried with GET.

-s, --skip <coma-separated-globs> is a list of globs or parts of URL to skip. As an example, -s *linkedin* -s hello will instruct to skip all URLs which contain either linkedin or hello in them.

--reporters <coma-separated-strings> is a list of reporters to process the result. Currently there are two: console and junit. console will print appealing colored report to the console. junit will produce junit-report.xml file in the current directory. JUnit file treats pages as test suites and URLs in a page as test cases.

--retries will instruct the number of times to try a URL before declaring it failed.

--user-agent <string> will use specified User-Agent header (some websites reply with 401 Unauthorized for "bots")

--ignore-prefixes <coma-separated-strings> is a list of prefixes/ schemas to skip, such as mailto:. Provided list should not include colons.

--accept-codes <coma-separated-numbers> is a list of HTTP code to consider successful, like 999 for linkedin.

--ignore-skipped excludes skipped URLs from reports.

--single-threaded mandates a sequential execution (should be used in for debugging).

-v, --verbose currently unused.

How to build

``` npm install # to install dependencies

npm run build # to compile TS (result in ./dist/index.js)

npm run coverage # to run tests and coverage ```

Owner

  • Name: Dmytro Bogatov
  • Login: dbogatov
  • Kind: user
  • Location: Boston, MA

GitHub Events

Total
Last Year

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 61
  • Total Committers: 1
  • Avg Commits per committer: 61.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Dmytro Bogatov d****o@d****g 61
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 1
  • Total pull requests: 9
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 months
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.44
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • 0xPrial (1)
Pull Request Authors
  • dependabot[bot] (9)
Top Labels
Issue Labels
Pull Request Labels
dependencies (9)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 20 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 19
  • Total maintainers: 1
npmjs.org: broken-links-inspector

Extract and recursively check all URLs reporting broken ones

  • Versions: 19
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 20 Last month
Rankings
Stargazers count: 12.5%
Dependent packages count: 16.2%
Forks count: 17.4%
Average: 18.2%
Downloads: 19.7%
Dependent repos count: 25.3%
Maintainers (1)
Last synced: 11 months ago

Dependencies

package-lock.json npm
  • 309 dependencies
package.json npm
  • @types/chai ^4.2.11 development
  • @types/mocha ^7.0.2 development
  • @types/sinon ^9.0.4 development
  • @typescript-eslint/eslint-plugin ^3.4.0 development
  • @typescript-eslint/parser ^3.4.0 development
  • chai ^4.2.0 development
  • eslint ^7.3.1 development
  • mocha ^8.0.1 development
  • mocha-junit-reporter ^2.0.0 development
  • nyc ^15.1.0 development
  • ts-node ^8.10.2 development
  • typescript ^3.9.5 development
  • @types/intercept-stdout ^0.1.0
  • @types/node ^14.0.13
  • @types/pluralize 0.0.29
  • axios ^0.21.1
  • chalk ^4.1.0
  • commander ^5.1.0
  • htmlparser2 ^4.1.0
  • intercept-stdout ^0.1.2
  • js2xmlparser ^4.0.1
  • matcher ^3.0.0
  • pluralize ^8.0.0