top | item 11736044

Export your Hacker News saved links to CSV using only Chrome console

89 points| thomaskcr | 10 years ago |github.com | reply

16 comments

order
[+] CDokolas|10 years ago|reply
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...
[+] CDokolas|10 years ago|reply
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!)

[+] amjd|10 years ago|reply
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. :)
[+] thomaskcr|10 years ago|reply
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.
[+] tnorthcutt|10 years ago|reply
What puts a link on your saved links page? I'd never noticed that page before.
[+] msh|10 years ago|reply
Up voting it.
[+] wiseleo|10 years ago|reply
Thanks, always was curious how to save localStorage into a CSV.