Skip to content

πŸ‘¨β€πŸ’» β€’ CURL client for Hacker News πŸ“° πŸ“°

License

Notifications You must be signed in to change notification settings

NalinPlad/hkkr.in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš™οΈ Hkkr.in πŸ—ž

The easiest way to get your daily hourly Hacker News dosage!

Uptime Robot status Uptime Robot ratio (7 days) GitHub GitHub stars
HKKRIN usage gif

Usage β€’ Hyperlinks β€’ Contributing β€’ ToDo


HKKR.IN - cURL client for Hacker News | Product Hunt

hkkr.in is offline until further notice while I work on other projects (I need to migrate it off AWS so until I do that, it remains offline)

Hkkr.in is a Curl client for Hacker News

I spend a lot of time in the terminal, and also lots of time on HN, so I made hkkr.in to make viewing HN in the terminal simple and accessible from any computer, not just ones that have HN CLI programs installed. I was inspired by the wttr.in which does a similar thing for the weather and for moon phases

If you want, you can donate to the project using the Sponsor button(at the top near the star and fork buttons), or by visiting this link. Tips will go towards hosting hkkr.in

Usage

Use curl hkkr.in/curlme to get similar info in the terminal

To get the top ten posts, run curl hkkr.in

A single result might look like this

1.  Bitwarden raises $100M
βž₯    β–΄646 ➀ hkkr.in/32735479 (bitwarden.com)

It shows the title, votes, link to the discussion, and the domain of the url. Use the link on the bottom (hkkr.in/32735479) to visit that articles page on HN

You can pass some parameters to your request to alter the output(some parameters accept numbers as options, like curl hkkr.in/n10)

Parameter Function
n(number) Number of results to show(max 100)
m(number) Max width of titles
f(number) Url mode [0: hkkr.in, 1: HN, 2: Article Url]
a Show all stories(max 100)
h Show https:// in story urls
u Ignore user-agent
l Use hyperlinks(requires modern terminal)

seperate parameters with a dash curl hkkr.in/n5-f2

Hyperlinks

Use the l parameter to enable modern terminal hyperlinks

Hkkr.in supports modern terminal emulator hyperlinks. By default, hyperlinks have a small underline present, which is is visually distracting. You can disable it, though the configurations are dependant on your specific terminal emulator. Here are instructions for Iterm2, and you can probably find similar config settings for your terminal.

Contributing

Want to help out? If you have any ideas, bugs, or suggestions, please open an issue here

If you want to help develop the project, feel free to open a pull request. When you run npm start the program will listen on port 3050, which you can change with the PORT variable in app.js

I wrote most of the code here quickly and its not the greatest. I may come in and refactor some of it in the future.

ToDo

Some planned features

  • Check user agent to serve an html version in the browser (redirects to github right now)
  • Option to disable ANSI escapes in case a terminal emulator doesent support them
  • Show date on posts(EG: 4 days ago)
  • Option to sort by date
  • Option to make hkkr.in/{ID} links go directly to url not discussion
// Thanks for using hkkr.in

About

πŸ‘¨β€πŸ’» β€’ CURL client for Hacker News πŸ“° πŸ“°

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project