Skip to content

NalinPlad/hkkr.in

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

βš™οΈ 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 β€’ Contributing β€’ ToDo


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

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 parameter 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

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
  • Option to disable ANSI escapes incase 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