4 releases (2 breaking)

Uses old Rust 2015

0.4.0 Apr 2, 2018
0.3.1 Aug 8, 2017
0.3.0 Jul 30, 2017
0.2.0 Jul 26, 2017

#6 in #hackernews


Used in touchnews

Apache-2.0

14KB
241 lines

hn-rs - Rust wrapper for the Hacker News (YCombinator) API

OSX/Linux Build Status Crates.io Version

hn-rs is a simple binding around the firebase APIs for fetching the news feed from Hacker News. It spawns a thread that regularly updates the top 60 items on Hacker News.

The main class, HackerNews, exposes this list in the most recently sorted order as a standard Rust iterator. The iterator returns copies of the items so the application can keep ownership if it wishes.

Currently it only exposes methods to request the title and URL of news items.

News items can be marked as 'hidden' so they are not returned in future passes through the iterator.

See the examples/ dir for usage.

Documentation

API documentation


lib.rs:

hn-rs: Bindings for Hacker News (YCombinator) news feed API

hn-rs is a simple binding around the firebase APIs for fetching the news feed from Hacker News. It spawns a thread that regularly updates the top 60 items on Hacker News.

The main class, HackerNews, exposes this list in the most recently sorted order as a standard Rust iterator. The iterator returns copies of the items so the application can keep ownership if it wishes.

Currently it only exposes methods to request the title and URL of news items.

News items can be marked as 'hidden' so they are not returned in future passes through the iterator.

See the examples/ dir for usage.

Dependencies

~9–18MB
~228K SLoC