Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Created August 6, 2019 16:25
Show Gist options
  • Save saagarjha/6f6474fd212bd9904e6d7cc81f2c275f to your computer and use it in GitHub Desktop.
Save saagarjha/6f6474fd212bd9904e6d7cc81f2c275f to your computer and use it in GitHub Desktop.
Grab timestamps for all your Hacker News comments
#!/usr/bin/env python3
import json
import re
import urllib.request
if __name__ == "__main__":
comments = json.load(urllib.request.urlopen("https://hacker-news.firebaseio.com/v0/user/saagarjha.json"))["submitted"][::-1]
for comment in comments:
timestamp = json.load(urllib.request.urlopen("https://hacker-news.firebaseio.com/v0/item/" + str(comment) + ".json"))["time"]
print(str(timestamp), flush=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment