Re:Show HN: Archivy-HN – automatically save and download you...
by ashish01 on Monday December 28, 2020 @02:27AM
(#25557438)
Cool. If you want an smaller alternative, just getting upvoted ids is easy enough in python
import requests
from bs4 import BeautifulSoup
with requests.Session() as session:
page = 1
while True:
resp = session.get(
f"https://news.ycombinator.com/upvoted?id=ashish01&p={page}",
cookies={"user": "get this from your browser"},
)
tree = BeautifulSoup(resp.text)
links = [x["href"] for x in tree.select(".subtext .age a")]
if len(links) == 0:
break
for i, link in enumerate(links):
print(page, i, link.split("=")[1])
page = page + 1
Re:Show HN: Archivy-HN – automatically save and download you...
by longnguyen on Monday December 28, 2020 @01:34AM
(#25557232)
Interesting. But for me upvoted links are already stored on Hacker News. What I wanted to download / archive is others' comments. Some comments are so valuable that I saved in a personal note (HN Wisdoms)
Re:Show HN: Archivy-HN – automatically save and download you...
by etherio on Sunday December 27, 2020 @06:05PM
(#25555032)
I'm thinking about doing something like that - I'll implement it because it'd also be quite useful.
Do you think it would be worthwhile to be able to save upvoted / favorited comments also? I also have to think about what context (ie parent / child comments) it would be useful to gather.
Re:Show HN: Archivy-HN – automatically save and download you...
by etherio on Sunday December 27, 2020 @06:18PM
(#25555097)
Hmm I see that could be interesting.
The software this script is built around [0] comes with a developing [1] search functionality.
The idea is that using these plugins and the main software one can group / save / search their digital identity - and that's exactly what saving comments would work towards.
Re:Show HN: Archivy-HN – automatically save and download you...
by dataflow on Sunday December 27, 2020 @07:26PM
(#25555482)
Upvoted comments is the one thing I've always wanted (I don't care for the rest). I often upvote things that are useful to refer back to, and without this there's no easy way to find them again.
Re:Show HN: Archivy-HN – automatically save and download you...
by mehrdadn on Sunday December 27, 2020 @08:11PM
(#25555788)
They're public? I don't necessarily feel a desire to make a public announcement about every comment I think might be interesting or worth referring back to.
Re:Show HN: Archivy-HN – automatically save and download you...
by krapp on Sunday December 27, 2020 @06:14PM
(#25555078)
The username endpoint in the HN API contains ids for all of that user's comments - you could take that and iterate the ids and download them from the API.
It could probably be done with a simple script and you would end up with a folder full of JSON files. Your ISP might hate you, though.
https://github.com/avinassh/haxor
https://github.com/jaredsohn/hnuserdownload
There was also a website which is not working. Going to turn that off now.
Do you think it would be worthwhile to be able to save upvoted / favorited comments also? I also have to think about what context (ie parent / child comments) it would be useful to gather.
HN has a search box, but afaik there's no way to filter by user, or to restrict the search to my upvoted comments, etc.
Downloading would be a good second-best option, because at least it would allow me to "grep" through the archives.
The software this script is built around [0] comes with a developing [1] search functionality.
The idea is that using these plugins and the main software one can group / save / search their digital identity - and that's exactly what saving comments would work towards.
[0]: https://archivy.github.io [1]: https://github.com/archivy/archivy/pulls/159
(I use them a lot: https://news.ycombinator.com/favorites?id=akkartik&comments=...)
It could probably be done with a simple script and you would end up with a folder full of JSON files. Your ISP might hate you, though.
https://github.com/avinassh/haxor