Skip to content

hamolicious/HTTP-Code-Lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Code Lookup

Allows you to very quickly view and search Wikipedia's HTTP Codes page.

What the hell is this?

Look up specific codes

code lookup

Filter using wildcards

wildcard lookup

Don't know the status code?

text lookup

How to run

Install requirements.txt using pip install -r requirements.txt. Although not required, setting up a virtualenv is advised.

Using Python

python main.py <search_term>

Using alias/DOSKEY

Setting up an alias for the script will allow you to use a custom, short "name" for any action.

For Unix systems place the following into .bashrc or .zshrc

alias http-code="path/to/python /path/to/main.py $@"

For Windows place the following into your bat file that runs on terminal startup. If you do not know how to set this up, look into this answer on Stack Overflow

DOSKEY http-code="path/to/python /path/to/main.py" $*

Arguments

The usage for the tool is as follows:

python main.py <search_term> --output-as-json --no-pretty --indent-size --no-colour
  • <search_term>
    • Mandatory: Can be either a 3 digit code (use x to replace unknowns, eg: 2xx for all codes starting with 2) or a text search.
  • --output-as-json
    • Optional: Output as JSON, by default will pretty-print JSON... use --no-pretty to disable
  • --no-pretty
    • Optional: Disable pretty printing of JSON, does nothing without --output-as-json flag set
  • --indent-size
    • Optional: Change the default (2) indent size
  • --no-colour
    • Optional: Disable colour for non-JSON output

How to test

python tests/test.py

Known Issues

  • Tests don't run on Windows systems :|

About

Allows you to very quickly view and search Wikipedia's HTTP Codes page.

Resources

Stars

Watchers

Forks

Languages