hnrss / hnrss

Custom, realtime RSS feeds for Hacker News
https://hnrss.github.io
509 stars 28 forks source link

Favourites endpoint is not returning results #88

Open sesh opened 1 year ago

sesh commented 1 year ago

Currently the endpoint does not return any items.

~ $ http https://hnrss.org/favorites?id=edavis

HTTP/1.1 200 OK
Cache-Control: max-age=3300
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 331
Content-Type: application/xml; charset=utf-8
Date: Fri, 30 Jun 2023 09:58:29 GMT
Expires: Fri, 30 Jun 2023 10:50:56 GMT
Server: nginx
Vary: Accept-Encoding
X-Algolia-Url: https://hn.algolia.com/api/v1/search_by_date?hitsPerPage=0&restrictSearchableAttributes=title&tags=%28story%2Cpoll%29%2C%28%29
X-Cache: HIT

<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Hacker News - edavis's favorites</title>
    <link>https://news.ycombinator.com/favorites?id=edavis</link>
    <description>Hacker News RSS</description>
    <docs>https://hnrss.org/</docs>
    <generator>hnrss v2.1</generator>
    <lastBuildDate>Fri, 30 Jun 2023 09:55:56 +0000</lastBuildDate>
    <atom:link href="https://hnrss.org/favorites?id=edavis" rel="self" type="application/rss+xml"/>
  </channel>
</rss>
edavis commented 1 year ago

Ah, bummer. HN is blocking the hnrss server from fetching their /favorites endpoint. Which is needed to populate the list of story IDs to be passed onto Algolia. Looks like they've been blocking it for awhile now (at least since June 16).

FWIW, I can't say I blame them. It's probably an expensive endpoint to maintain with a long-tail that makes caching hard and it's a pretty popular feed on hnrss . I never particularly liked the HTML parsing, I just couldn't figure out another way.

I'll see if I can surface favorites data from the official API. Or one could self-host the hnrss binary and favorites should come back (everything is working locally).

If I can't get the official API to work, I'll probably have to retire this endpoint.

Thanks for the report.

sesh commented 1 year ago

Thanks for looking into it and the quick response. I figured it would be something like this.

My use-case is a very small side project, so I'll likely just parse the HTML myself and keep calls to a few a day to stay under the radar.

Thanks for your great work on this project!