基于hackernews firebase api的python包装器
hntop的Python项目详细描述
Hacker News官方Firebase API上的非官方Python包装。
安装
> pip install hntop
用法示例
获取项目
>>>fromhnapiimportHnApi>>>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'
获取用户
>>>fromhnapiimportHnApi>>>user=HnApi().get_user('pg')>>>user.get('about')u'Bug Fixer.'>>>user.get('karma')155046>>>user.typeu'user'
顶级故事
>>>fromhnapiimportHnApi>>>top=HnApi().get_top()>>>top[8959672,8960995,8961086,8960029,8960773,8959207,8960504,8960280,8960486,8959875,8955426,8958731,8961438,8961093,8959138]
最大项目
>>>fromhnapiimportHnApi>>>con=HnApi()>>>max_item_id=con.get_max_item()>>>max_item_id8967822>>>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..'
许可证
阿帕奇