Last active
February 14, 2022 00:02
-
-
Save mtfoley/881671712965ef6d6349ae16890f9432 to your computer and use it in GitHub Desktop.
This file contains 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
# List latest dev.to articles (curl), Extract non-blank tags and join by comma (jq) | |
# Replace commas with newlines (sed), Sort in alphabetical order and count unique words in format (sort | uniq -c) | |
# Sort again in reverse order to put highest counts at the beginning (sort -r), Switch print order to be "tag n" (awk) | |
curl -s "https://dev.to/api/articles?page=1&per_page=1000&state=fresh" \ | |
| jq --raw-output 'map(.tags | select(.!="")) | join(", ")' \ | |
| sed 's/, /\n/g' \ | |
| sort | uniq -c \ | |
| sort -r \ | |
| awk '{ print $2, $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment