Comment

Comment by dragonwriter

That doesn’t quite work, because JSON objects are parsed to Python dicts, not Python objects with properties, so it would be:

  data = json.load(sys.stdin)
  commits = [
    e["commit"] 
    for e in data 
    if e["commit"]["author"] == "Tom Hudson"
  ]
  json.dump(commits, sys.stdout)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton