Skip to content

Pings a URL and checks the HTTP status code. Based on the status code, prints the URL and status code in color (on CI).

License

Notifications You must be signed in to change notification settings

amitkc1/LinkChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkChecker

Pings a URL and checks the HTTP status code. Based on the status code, prints the URL and status code in color (on CI). This is useful in finding broken links from the list of provided URLs

This is how it works:

  1. If the status code is less than 300, prints the provided URL in green color and adds the URL and status code to the report file.

  2. If the status code is 301 or 302, prints the original/provided URL in blue color, adds the URL and status code to the report file. Pings the redirected URL after that

  3. If the status code is greater than 400, prints the original/provided URL in red color, adds the URL and status code to the report file.

  4. The project also has Mobile linkchecker. This will add a user agent to the request property and make sure that mobile URLs are working as expected.

  5. The connection timeout and readtimeout for each URL is 10 seconds. It means that, the same number URLs could finish faster against one server and could be slower on another.

  6. For execution, create a LinkChecker.csv file and add a header "URLS" in the first column. After that add as many URLs as you want.

  7. Sample output is available here: https://github.com/amitkc1/LinkChecker/blob/master/images/sampleOutput.png


Usage:

This program can be executed from IDE or CI. This is a single threaded linkchecker, I will be committing changes in near future to make it multithreaded. At the end of execution, this will create a text report.


Features:

  1. Creates a report that includes response code for each URL. This makes it easy to analyze the report and find out the failures.
  2. Customized messages for errors
  3. Color coding to spot failures easily
  4. Allows users to set mobile user agent.

About

Pings a URL and checks the HTTP status code. Based on the status code, prints the URL and status code in color (on CI).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages