Last active
April 7, 2021 07:16
-
-
Save tnzk/11a57e5422bd53878d18fe27f29313ae to your computer and use it in GitHub Desktop.
Download all of top-level comments in a story and generates histgram of words
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cf. https://github.com/HackerNews/API | |
ITEM_ID=8863 | |
curl https://hacker-news.firebaseio.com/v0/item/$ITEM_ID.json | jq -r .kids[] | xargs -I {} echo "curl -o {}.txt https://hacker-news.firebaseio.com/v0/item/{}.json" | |
cat *txt | tr '[:punct:]' ' ' | tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '\n' | sort | uniq -c | sort -rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment