Hacker News new | past | comments | ask | show | jobs | submit login
Export your Hacker News saved links to CSV using only Chrome console (github.com/thomaskcr)
89 points by thomaskcr on May 20, 2016 | hide | past | favorite | 16 comments



Anyone find a way to do this in Firefox as well? It seems to work; except, it won't save the data in CSV. I'll try to get the raw JSON data...


got it working with the following:

window.location=window.URL.createObjectURL(new Blob([localStorage.getItem('hn_saved')],{type:'x-whatever/x-backup'}));

file name is weird (I'm a JS newb!)


Thanks for sharing, I figured there would be some type of issue with the download portion in other browsers. I'll see if that works in Chrome too and then maybe edit so more people can use it out of the box.


Good work OP! I have been meaning to write a python script to do this for a while now. However, entering the code for each page may soon get tedious. (I have 88 pages of saved links.) I'll probably get down to writing that script anyway and share here when I'm done with it. :)


Thanks, there are obviously much better ways to do this (even something like GreaseMonkey over using the console), I was going more for an optimization of total time invested. It takes less than 5 seconds per page, so you could probably still swing doing 88 in less than 10 mins pretty easily.


FWIW, I had to do something similar and used http://inorganik.github.io/debugout.js/ It worked really well and using jQuery (inject it) make the code really simple to write.


What puts a link on your saved links page? I'd never noticed that page before.


Up voting it.


I really wish there was a way to save a link for later reading without up voting.

Sometimes I'm on my phone, see an interesting title I can't read right at the moment, but feel weird about upvoting it without actually reading it first.

I've tried using read-it-later apps, but that works mostly for the articles and not the comments on HN which I find just as important.


What's wrong with voting?


Just bookmark the link.


I don't have a save button


Upvoting a story adds it to your saved links. You can access your saved links here: https://news.ycombinator.com/saved?id=<username>


Thanks, always was curious how to save localStorage into a CSV.



That doesn't give you access to saved stories. Saved stories are stories that you voted on and are "private" to the user.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: