Created
August 6, 2019 16:25
-
-
Save saagarjha/6f6474fd212bd9904e6d7cc81f2c275f to your computer and use it in GitHub Desktop.
Grab timestamps for all your Hacker News comments
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
#!/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