Last active
December 26, 2020 12:36
-
-
Save goranmoomin/83e2f83213a4fc5d0a88589f45f4e83b to your computer and use it in GitHub Desktop.
Shell one liners to get various HN account information
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
#!/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'\' |
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
#!/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'\' |
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
#!/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