Giter Site home page Giter Site logo

christopherjhart / markdown-link-checker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4 KB

Python script that verifies whether URLs linked in Markdown files are still valid and checks to see if they can use HTTPS if HTTP is currently in use

License: MIT License

Python 100.00%

markdown-link-checker's Introduction

Markdown Link Checker

This Python script scans through a local, user-provided Markdown file, locates all URLs within the file, and performs two checks:

  1. Ensures that the URL is still accessible (in other words, that it does not return a 404 or is redirected)
  2. If the URL utilizes HTTP over HTTPS, checks to see if it can use HTTPS and alerts the user if it can

Getting Started

With these instructions, you will be able to deploy this script and analyze URLs within a local Markdown file.

  1. Clone this repository
git clone https://github.com/ChristopherJHart/markdown-link-checker.git
  1. Move into the repository's directory
cd markdown-link-checker
  1. Execute the script using a Python 3 binary, passing in the filepath of a Markdown file as an argument
python3.6 markdown-link-checker.py /Users/Example/my_markdown_file.md
  1. After a few moments, you should see the results of the script on the console.
Issue with URL: http://viptela.com/
Issue with URL: http://www.apstra.com/products/
Issue with URL: http://www.anutanetworks.com/ncx-overview/
Insecure URL http://rundeck.org/ detected!
        Use https://rundeck.org/ instead
Issue with URL: http://www.intellimentsec.com/
Issue with URL: http://www.rconfig.com/
Insecure URL http://cisco.com/go/nso detected!
        Use https://cisco.com/go/nso instead
Insecure URL http://www.intentionet.com/ detected!
        Use https://www.intentionet.com/ instead
Insecure URL http://packetpushers.net/podcast/podcasts/pq-show-99-netmiko-napalm-network-automation/ detected!
        Use https://packetpushers.net/podcast/podcasts/pq-show-99-netmiko-napalm-network-automation/ instead
Insecure URL http://packetpushers.net/podcast/podcasts/pq-show-81-network-testing-todd/ detected!
        Use https://packetpushers.net/podcast/podcasts/pq-show-81-network-testing-todd/ instead
Insecure URL http://packetpushers.net/podcast/podcasts/pq-135-mastering-python-networking-book/ detected!
        Use https://packetpushers.net/podcast/podcasts/pq-135-mastering-python-networking-book/ instead
Issue with URL: http://jinja2test.tk/
  1. For more details, review the markdown-link-checker.log file created within the markdown-link-checker directory. This is especially useful if you run the script with the --debug flag.
$ tail markdown-link-checker.log
2018-10-27 22:54:28,685 ERROR    [https://slack.networktocode.com] Timed out while accessing URL
2018-10-27 22:54:28,685 DEBUG    [http://slack.networktocode.com] HTTPS does not work, reverting to HTTP
2018-10-27 22:54:33,803 ERROR    [https://jinja2test.tk/] Timed out while accessing URL
2018-10-27 22:54:33,803 DEBUG    [http://jinja2test.tk/] HTTPS does not work, reverting to HTTP
2018-10-27 22:54:34,113 ERROR    [http://jinja2test.tk/] Issue with URL | Code: 203

License

This project is licensed under the MIT license - see the LICENSE.md file for details.

markdown-link-checker's People

Contributors

christopherjhart avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.