Skip to main content

Python wrapper over HackerNews Firebase API

Project description

Build Status Coverage Status Version License

Unofficial Python wrapper over Hacker News’ official Firebase API.

Install

> pip install hntop

Usage Examples

Get Item

>>> from hnapi import ApiConnector
>>> con = ApiConnector()
>>> item = con.get_item(8863)
>>> item.get('title')
u'My YC app: Dropbox - Throw away your USB drive'
>>> item.get('by')
u'dhouston'

Get User

>>> from hnapi import ApiConnector
>>> user = ApiConnector().get_user('pg')
>>> user.get('about')
u'Bug Fixer.'
>>> user.get('karma')
155046

Top Stories

>>> from hnapi import ApiConnector
>>> top = ApiConnector().get_top()
>>> top
[8959672, 8960995, 8961086, 8960029, 8960773, 8959207, 8960504, 8960280, 8960486, 8959875, 8955426, 8958731, 8961438, 8961093, 8959138]

Max Item

>>> from hnapi import ApiConnector
>>> con = ApiConnector()
>>> max_item_id = con.get_max_item()
>>> max_item_id
8967822
>>> max_item = con.get_item(max_item_id)
>>> max_item.get('type')
u'comment'
>>> max_item.get('text')
u'Interesting. Being partially colour blind I would have thought that the original was much greener, while the re-release is a lot bluer and..'

License

Apache

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hntop-0.0.8.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

hntop-0.0.8-py2-none-any.whl (20.0 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page