Menu

Your Mention Counter Thinks Hate Is Love
📰

Your Mention Counter Thinks Hate Is Love

DEV Community: api·RobustTrueTry·14 days ago
#iCJzI2a4
#devtoapi#devto#dev#title#book
Reading 0:00
15s threshold

HackerBooks is a nice idea: point a pipeline at two decades of Hacker News comments and get a crowd-ranked bookshelf. It works well enough that the gaps are easy to miss. The gap that matters is the scoring. Every mention increments the same counter, so a book that commenters uniformly dislike can outrank a quiet classic.

By the end you will be able to pull HN comments, extract candidate book titles, resolve them to real works, and score them in a way that does not reward controversy.

Pull the comments

The HN search API is the practical starting point. Algolia mirrors every story and comment, and search_by_date lets you page forward with a timestamp cursor so you never re-fetch old data.

import requests , time

BASE = " https://hn.algolia.com/api/v1/search_by_date "

def fetch_comments ( query , pause = 0.2 ): cursor = 0 while True : resp = requests .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.