Skip to content

Instantly share code, notes, and snippets.

@goranmoomin
Last active December 26, 2020 12:36
Show Gist options
  • Save goranmoomin/83e2f83213a4fc5d0a88589f45f4e83b to your computer and use it in GitHub Desktop.
Save goranmoomin/83e2f83213a4fc5d0a88589f45f4e83b to your computer and use it in GitHub Desktop.
Shell one liners to get various HN account information
#!/bin/sh
curl -s https://hacker-news.firebaseio.com/v0/user/pcr910303.json | jq '.submitted | .[]' | xargs -P30 -I{} sh -c 'curl --silent https://hacker-news.firebaseio.com/v0/item/{}.json | jq --raw-output '\''select(.type == "story" and .deleted != true) | .title'\'
#!/bin/sh
curl -s https://hacker-news.firebaseio.com/v0/user/pcr910303.json | jq '.submitted | .[]' | xargs -P30 -I{} sh -c 'curl --silent https://hacker-news.firebaseio.com/v0/item/{}.json | jq --raw-output '\''select(.type == "story" and .deleted != true and .score >= 5) | .title'\'
#!/bin/sh
curl -s https://hacker-news.firebaseio.com/v0/user/pcr910303.json | jq '.submitted | .[]' | xargs -P30 -I{} sh -c 'curl --silent https://hacker-news.firebaseio.com/v0/item/{}.json | jq --raw-output .url' | python3 -c '
import sys
from urllib.parse import urlparse
for line in sys.stdin:
print(urlparse(line).netloc)
' | grep -v '^$' | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment