https://github.com/python273/hn-index
Search Hacker News stories by title with regex CLI
https://github.com/python273/hn-index
cli hackernews rust
Last synced: 11 months ago
JSON representation
Search Hacker News stories by title with regex CLI
- Host: GitHub
- URL: https://github.com/python273/hn-index
- Owner: python273
- License: mit
- Created: 2021-05-03T16:00:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-03T03:42:08.000Z (about 1 year ago)
- Last Synced: 2025-01-07T21:48:35.059Z (about 1 year ago)
- Topics: cli, hackernews, rust
- Language: Rust
- Homepage:
- Size: 671 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hn-index
Search Hacker News stories' titles with [regex](https://docs.rs/regex/1.7.1/regex/index.html#syntax).
```
$ wget https://python273.pw/hackernews-stories-dump-1_42024703.tar.gz
$ tar xf hackernews-stories-dump-1_42024703.tar.gz
$ cargo build --release
$ ./target/release/hn-index "(?i)\brust"
[...]
101 Rust Language Cheat Sheet https://hkrn.ws/26930908
45 Show HN: High-speed UTF-8 validation in Rust https://hkrn.ws/26887438
[...]
Found stories 11089
Scan time 24.53346ms
Print time 30.233548ms
Total time 54.782431ms
```
`hn-index (regex) [min comments]`

## Dump
Header: `[checkpoint; u32 little endian]*31` (offsets to start scanning by CPU threads)
Format: `[title len; u8][comments num; u16 little endian][title; utf-8][id; u32 little endian]`