A Python-based CLI for working with Hacker News.
Requirements can be installed directly by using:
pip install -r requirements.txt
Using hackernews from command line
hackernews uses a built-in cookie system. It saves the file
hackernews.py <command> --no-cookies
When cookies are turned off, two additional requests are needed per-command to retrieve proper login info.
Retrieve a user's latest saved items, and print the output as JSON (default):
hackernews.py saved -u 'username' -p 'password'
Retrieve all saved items, and print the output as XML (this might take a while):
hackernews.py saved --all -e xml -u 'username' -p 'password'
Help for the
hackernews.py saved -h
Retrieve a user's comment threads, and print the output as JSON (default):
hackernews.py comments -u 'username' -p 'password'
Retrieve all comments, and print the output as XML (this might take a while):
hackernews.py comments --all -e xml -u 'username' -p 'password'
Don't show owner's comments (the logged-in user); this is useful for a feed of replies to your comments:
hackernews.py comments --no-owner -u 'username' -p 'password'
Help for the
hackernews.py comments -h
Using hackernews from a python app
import hackernews hackernews.saved(username='username', password='password', all=True) # and so on