News for hackers. Stuff that matters.
Re:Show HN: A CLI to avoid remembering HTTP status codes by tuxie_ on Wednesday July 20, 2022 @09:35AM (#32165580)
From your description I thought for a second that you were somehow parsing the page :D
Re:Show HN: A CLI to avoid remembering HTTP status codes by capableweb on Wednesday July 20, 2022 @10:02AM (#32165943)
On that note, this is the shell alias I use to remember status codes (using htmlq https://github.com/mgdm/htmlq):

    alias status_codes="curl --silent https://developer.mozilla.org/en-US/docs/Web/HTTP/Status | htmlq --text 'dt a code'"
Prints something like this:

    100 Continue
    101 Switching Protocols
    102 Processing
    103 Early Hints
    200 OK
    201 Created
    202 Accepted
    203 Non-Authoritative Information
    204 No Content
    205 Reset Content
    206 Partial Content
    ...
To get specific groups, I do something like this:

    status_codes | grep ^2
Replacing 2 with whatever group you want, like 4 for 4xx codes for example
Re:Show HN: A CLI to avoid remembering HTTP status codes by mxuribe on Wednesday July 20, 2022 @11:22AM (#32167060)
Wow, how have i never heard of htmlq!?! Thanks for sharing your alias as well as teaching me another cool tool (htmlq)!