Generates RSS feed for Lobste.rs that filters by score and provides comments as link.
  • Python 95.9%
  • Dockerfile 4.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Brenno Flávio de Almeida 2d6a46eda9
All checks were successful
Publish container image / publish (push) Successful in 5m8s
Merge pull request 'Expose a cached Lobsters RSS API' (#1) from cached-rss-api into master
Reviewed-on: #1
2026-09-21 04:11:24 +00:00
.forgejo/workflows Publish container image with Forgejo Actions 2026-09-21 00:49:30 -03:00
tests Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
.dockerignore Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
app.py Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
Dockerfile Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
LICENSE Add LICENSE and README 2019-07-29 09:15:53 -04:00
lobsters-bisque.py Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
README.md Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00
requirements.txt Expose cached Lobsters RSS API 2026-09-21 00:42:47 -03:00

lobsters-bisque

A small HTTP API that serves an RSS feed of Lobsters stories scoring at least two points. Item links point to the Lobsters discussion page.

Run locally

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python app.py

The feed is available at http://localhost:8000/rss and the health endpoint is http://localhost:8000/healthz.

Caching

The API retains the rendered feed in memory for 10 minutes by default. All requests during that interval receive the cached response, so Lobsters is fetched at most once per process per interval. Refreshing is serialized, preventing simultaneous cache misses from generating duplicate upstream requests. If refresh fails after a successful response, the last good feed remains available for the next interval.

Score requests are also paced by 100 ms. Set CACHE_TTL_SECONDS to choose another interval or SCORE_REQUEST_DELAY_SECONDS to choose another delay. The cache is process-local; the container intentionally uses one Gunicorn worker so all requests share it.

Docker

docker build -t lobsters-bisque .
docker run --rm -p 8000:8000 -e CACHE_TTL_SECONDS=600 lobsters-bisque

Testing

python -m unittest discover -s tests