Coder Social home page Coder Social logo

hackernews-top's Introduction

Hacker News Top

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 HnApi
>>> con = HnApi()
>>> 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 HnApi
>>> user = HnApi().get_user('pg')
>>> user.get('about')
u'Bug Fixer.'
>>> user.get('karma')
155046
>>> user.type
u'user'

Top Stories

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

Max Item

>>> from hnapi import HnApi
>>> con = HnApi()
>>> 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..'

Documentation

Documentation

License

Apache

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.