I figure since a comment of mine sparked 'saved comments' being a thing that lightning could strike twice...but then I guess the API would need to allow authentication for private data.
Alas, I couldn't get this working. Never used Python before so I'm unsure how to fix it, but it seems like something breaks when the title is undefined.
Was excited to as well, was going to write a script that fed this into Pinboard. Maybe I'll code up my own upvoted item scraper later.
Enter your HN account details:
Username: firloop
Password:
Logging in...
Logged in successfully.
Error getting data for page 1
Traceback (most recent call last):
File "export_links.py", line 137, in <module>
main()
File "export_links.py", line 113, in main
if len(tree_title) < 61:
UnboundLocalError: local variable 'tree_title' referenced before assignment
$ python export_links.py
Enter your HN account details:
Username: 0xcmp
Password:
Logging in...
Logged in successfully.
Error getting data for page 1
Error getting data for page 2
Error getting data for page 3
Error getting data for page 4
[...snip]
Note: script requires you to enter in your HN authentication details. (Unavoidable, since the HN API neither supports authentication nor an endpoint for saved stories)
It's ten times better than entering your credentials on another website, but the code could still do some fun stuff with it. I kinda doubt it, but just saying.
The code is there for you to see, what harm can it possibly do? If you're cautious of this, you should be cautious about entering your username/password into web browsers to sign into websites I think...
The codebase can easily get big enough to miss it transmitting your credentials if you don't spend hours looking at it. Even in a 100 line script you can overlook a well hidden request, especially if it's extra data included in an existing request.
I figure since a comment of mine sparked 'saved comments' being a thing that lightning could strike twice...but then I guess the API would need to allow authentication for private data.