Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gabrielsroka
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
70 ms
·
1141.
▲
by
gabrielsroka
7y ago
[I posted this as a "Show HN" a few days ago [0]] I wrote a short JavaScript snippet to export HN Favorites to a CSV file. It scrapes the HTML and navigates from page to page. Setup and usage instructions are in the file. Check ou
1142.
▲
by
gabrielsroka
7y ago
PowerShell commands are not case sensitive. Commands use <Verb>-<Adjective><Noun> structure, for example Get-ADUser gets an AD user. Once you learn that, it's easy to know that the equivalent command for AzureAD is Ge
1143.
▲
by
gabrielsroka
7y ago
In fairness, when I ported the Bash version to PowerShell and then Python, the Bash version was much shorter. rasengan later added a lot of functionality to the Bash version. And the point was to demonstrate some of the functionality in a s
1144.
▲
by
gabrielsroka
7y ago
Thanks rasengan. I've been using PowerShell for about 5 years now. I was trying to learn Bash, but I found too limiting -- it was like going backwards. So, I started learning Python. You'll notice that the PowerShell and Python ve
1145.
▲
by
gabrielsroka
7y ago
I think this one is a little cleaner. I used some of the ideas in sbr464's code. path = 'favorites?id=app4soft' while path: r = requests.get('https://news.ycombinator.com/' + path)
1146.
▲
by
gabrielsroka
7y ago
In Python, `range(1, 17)` produces the numbers 1-16. I hard-coded it just for your favorites. A better way to solve it is to look at the `len()` of the results, and stop when it gets to 0: p = 1 while True: r = requests.get(f&#x
1147.
▲
by
gabrielsroka
7y ago
Thanks for the tip. I gave the "Scraper" extension a try, and 1) I got an error, 2) it only seems to scrape 1 page -- it doesn't paginate (or, did I miss something?). I used the jQuery selector `a.storylink`.
1148.
▲
by
gabrielsroka
7y ago
@amjd, thanks for sharing. I upgraded it from Python 2 to Python 3, but when I ran it, I got a 404 error on the `saved` endpoint. Does it work for you? Edit: I see from the other PR it's called `upvoted`. Edit 2: I changed it to `upvot
1149.
▲
by
gabrielsroka
7y ago
Part of the advantage of running JavaScript in your browser is that you might already be authenticated and it can use your session. But, fetching your HN favorites doesn't require authentication. #!/usr/bin/env pytho
1150.
▲
by
gabrielsroka
7y ago
Ok, now that's really smart! Would a client using your API paginate to fetch, say, 50 pages? When I tried it using ?limit=50, I got a 504 error. Thanks! (Edit, never mind, I see you explain it in the readme.)
1151.
▲
by
gabrielsroka
7y ago
Thanks dvfjsdhgfv. If there's sufficient interest, I can easily turn it into a Chrome extension. (Edit: haha, I see what you just did there. A little recursive humor.)
1152.
▲
by
gabrielsroka
7y ago
Thanks Simon. I'd originally written this script to export my DVD ratings from Netflix, since there's no API for that either. It was easy to adapt it to HN. I wanted to show people that it's possible (and easy) to get to your
1153.
▲
Show HN: Export HN Favorites to a CSV File
240 points
by
gabrielsroka
7y ago
|
39 comments
1154.
▲
by
gabrielsroka
7y ago
I have some JavaScript you can run from your browser that will scrape the HTML, navigate from page to page, and save the results in a CSV file. Setup and usage instructions are in the file. Check out: https://gabrielsroka.github.
1155.
▲
by
gabrielsroka
7y ago
I believe the article is wrong, eg, see: https://developer.okta.com/docs/guides/updating-saml-cert/ge...
1156.
▲
by
gabrielsroka
7y ago
Yes, you're right. It's an artifact from an old version (it used to work). I left the "Prev" button in because it helps to line up the "Next" button with my thumb (on mobile). Lazy, but ergonomic.
1157.
▲
by
gabrielsroka
7y ago
I got tired of all the bad news, so I added a filter. It's about 100 lines of JavaScript (a SPA?) that uses the official HN API. It's designed mostly for mobile use. Since I read HN a lot, it keeps track (using localStorage) of wh
1158.
▲
Show HN: HN reader that filters out COV**-19 and Coronavir** articles
(gabrielsroka.github.io)
52 points
by
gabrielsroka
7y ago
|
63 comments