Live data from Hacker News

Hacker News API

blog.ycombinator.com

201–210 of 315 posts

Re: Hacker News API

#201
post #70
post #65

Earlier quoted context omitted.

Use the Firebase libraries rather than the REST one to efficiently handle requests. I believe it uses a websocket internally. "It does all the work for you and is awesome." to quote Nick.

Also, while they don't have a Windows Phone API I previously wrote a COM Windows Scripting API to use it via Chackra from an ASP.Net app. I think it's even easier now that JS is a supported app language.

Didn't they remove support for calling COM APIs (i.e. ActiveX) in Chakra? (At least in IE 10 and later, I think - the versions with proper EcmaScript 5 support.)

Re: Hacker News API

#202
I wrote a stupid simple wrapper and pushed it to PyPI. My excuse is that I needed to learn how to use setuptools today.

    pip install hackernews-python
Usage:

    >>> from hackernews import HackerNews
    >>> hn = HackerNews()
    >>> hn.top_stories()
    [8422599, 8422087, 8422928, 8422581, 8423825...
    
    >>> hn.user('pg')
    {'delay': 2, 'id': 'pg', 'submitted': [7494555, 7494520, 749411...

    >>> hn.item(7494555)['title'])
    Hacker News API

    >>> hn.max_item()
    8424314

    >>> hn.updates()
    {'items': [8423690, 8424315, 8424299...], 'profiles': ['exampleuser',...]}

https://github.com/abrinsmead/hackernews-python

Re: Hacker News API

#203

This... is cool, but also kinda sucks for me. I've invested dozens of hours into writing an extremely complicated scraper for my Android version of HN. https://play.google.com/store/apps/details?id=com.airlocksof... The newest version (still under development, probably a month or two from release) adds support for displaying polls, linking to subthreads, and full write support (voting, commenting, submitting, etc). I…

Yeah, I like it a lot, but I've put tons of time into my scraper for Reader YC (https://github.com/krruzic/Reader-YC). I support everything but polls currently. This api is nice but my scraper actually supports more... No option to get Show HN, Ask HN or New afaik. Still glad this is out!

Re: Hacker News API

#204
post #188
post #183

Earlier quoted context omitted.

You can't simply decode each character without losing information. For example, < means a literal If you're just planning on displaying the text in a browser, no decoding is needed. If you want to parse the text to do some sort of textual analysis, an HTML parser library might be best.

I understand what you're talking about re: < and ' You've given me an idea though, so back to vi for me. Thx.

not sure if you figured something out already, but just saw your comment and remembered that this exists in PHP:

http://us1.php.net/manual/en/function.get-html-translation-t...

absent another source, you could dump it out for your usage elsewhere.

  % php -r 'print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES|ENT_HTML5));'
or

  % php -r 'print json_encode(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES|ENT_HTML5));' | jq .
edit: just found http://dev.w3.org/html5/html-author/charref (but might be harder to parse..)

Re: Hacker News API

#205
post #204
post #188

Earlier quoted context omitted.

I understand what you're talking about re: < and ' You've given me an idea though, so back to vi for me. Thx.

not sure if you figured something out already, but just saw your comment and remembered that this exists in PHP: http://us1.php.net/manual/en/function.get-html-translation-t... absent another source, you could dump it out for your usage elsewhere. % php -r 'print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES|ENT_HTML5));' or % php -r 'print json_encode(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES|ENT…

[deleted]

Re: Hacker News API

#206

Oh man you guys, patio11 has generated massive amounts of content: https://hacker-news.firebaseio.com/v0/user/patio11.json?prin... I count 8,483 submissions. I'm sure there's something interesting to be done with all of this data. A word frequency chart? --- Edit: So apparently there's a ruby gem that lets you feed it a body of text and generates pseudo-random phrases based on that text. I present to you the patio11…

In February, I did an analysis on all Hacker News stories: http://minimaxir.com/2014/02/hacking-hacker-news/ Yesterday, I published an analysis on all Hacker News comments: http://minimaxir.com/2014/10/hn-comments-about-comments/ There's a lot of interesting trends in the data. Let me know if you want to know anything in particular and I'll get back to you. :)

I would be interested to know the average hourly cost of HN in lost productivity :)

Re: Hacker News API

#208
post #104

Earlier quoted context omitted.

It's interesting that you mention the phenomenom of "I remember seeing it (or maybe even saying it) but I cannot find it". This has happened to me a lot. It is intensely frustrating to me because it's blocking - I don't get much done until I re-find whatever it was. I wonder how many other people have this? And what their techniques are?

I have the same problem, and I think the best solution would be to index my web browser search history and be able to search through that index. However that would probably generate a lot of junk. My current solution is to bookmark anything that's vaguely interesting. And when I remember something, I search through the bookmarks. I never look at them, they're just for keeping the stack of stuff to search through.

I am using the same approach too. However, most of the old stories I had liked at HN were not bookmarked, so I had to struggle writing a scaper for them. It would be very cool to be able to authenticate and grab all my saved stories and the comments for archiving and fun!

Re: Hacker News API

#209

Earlier quoted context omitted.

Please do convert it, I am working on a project with some of your code as a base!

You're using the app, or the scrapping engine (Hacker Swifter)? The nice thing is that HackerSwifter public API is already in a quite finished state for the available functions, even if I switch to the API, the method calls will be the same.

I am actually using the app because I am doing a mashup of HackerNews and another piece of software. If I decide to end up changing the UI a lot (which looks like it is trending towards), I was thinking of switching to the scraping engine. It's awesome that I won't have to change a lot if you do switch to the API. I'm following on GitHub, keep up the great work!

Re: Hacker News API

#210

Earlier quoted context omitted.

In February, I did an analysis on all Hacker News stories: http://minimaxir.com/2014/02/hacking-hacker-news/ Yesterday, I published an analysis on all Hacker News comments: http://minimaxir.com/2014/10/hn-comments-about-comments/ There's a lot of interesting trends in the data. Let me know if you want to know anything in particular and I'll get back to you. :)

I would be interested to know the average hourly cost of HN in lost productivity :)

I'd like to know the average hourly amount earned from HN. I know personally HN has helped me greatly in the projects I do at work.
Post reply on HN