3 ms·
Updated my Hacker News summary script to use Claude 3 Opus, first described here: https://til.simonwillison.net/llms/claude-hacker-news-themes https://til.simon
by simonw 3y ago
Updated my Hacker News summary script to use Claude 3 Opus, first described here: https://til.simonwillison.net/llms/claude-hacker-news-themes https://til.simonwillison.net/llms/claude-hacker-news-themes
#!/bin/bash
# Validate that the argument is an integer
if [[ ! $1 =~ ^[0-9]+$ ]]; then
echo "Please provide a valid integer as the argument."
exit 1
fi
# Make API call, parse and summarize the discussion
curl -s "https://hn.algolia.com/api/v1/items/$1" | \
jq -r 'recurse(.children[]) | .author + ": " + .text' | \
llm -m claude-3-opus -s 'Summarize the themes of the opinions expressed here.
For each theme, output a markdown header.
Include direct "quotations" (with author attribution) where appropriate.
You MUST quote directly from users when crediting them, with double quotes.
Fix HTML entities. Output markdown. Go long.'
Here's the result of running that against this 300+ comment thread:
./hn-summary.sh 39590666
Response: https://gist.github.com/simonw/37781de39fb5555f39b4157a8ad0776c https://gist.github.com/simonw/37781de39fb5555f39b4157a8ad07...