

Hacker News Trends - karangoeluw
http://hnify.herokuapp.com/get/trends

======
sant0sk1
Not sure what this is as it appears to be down at the moment, but I wrote an
HN trends tool awhile back as well:
[http://hntrends.jerodsanto.net](http://hntrends.jerodsanto.net)

~~~
RK
Interesting to see the trends about HN (plateaued?) and pg and YC (declining).

Other things are relatively predictable: NSA, bitcoin, docker, or diaspora.

Android reached parity with iphone around the end of 2010.

~~~
nly
I quite like this one

[http://hntrends.jerodsanto.net/?q=%22written+in+go%22](http://hntrends.jerodsanto.net/?q=%22written+in+go%22)

------
dylandrop
Personally I'd make it not sample the same phrase within the same article
title, or count subphrases as a different topic... In particular, there's an
article with "China Mobile" mentioned twice, and it seems to be counted twice
for that subject, as well as the subphrase "China" and "Mobile" being counted
twice, each as a separate topic.

To show you what I mean:

{ "trends": [ { "count": 2, "phrase": "China" }, { "count": 2, "phrase":
"Hacker" }, { "count": 2, "phrase": "Redis" }, { "count": 2, "phrase":
"Mobile" }, { "count": 2, "phrase": "China Mobile" }, { "count": 2, "phrase":
"How To" } ] }

~~~
karangoeluw
You're right. I do plan on improving the call. This was one of my ideas, but
then I was confused about which one to keep - one word or the two word topic.

~~~
dylandrop
Perhaps the one with a higher count, and if they both have the same count (in
the case of the "China Mobile" phrase) keep the longer one. You might want to
test different strategies against different sets of data and see which makes
more sense.

~~~
karangoeluw
That's a good idea. I'll definitely work on making the API faster.

------
karangoeluw
Ok guys here's the deal. Everything is back to normal now. However, you won't
get enough trends. I am now using just the front page to find trends. If you'd
like more data, change the `page_limit` here
[https://github.com/karan/HNify/blob/master/app.py#L120](https://github.com/karan/HNify/blob/master/app.py#L120)

------
karangoeluw
API source: [https://github.com/karan/HNify](https://github.com/karan/HNify)

~~~
xux
what framework are you using to render the graph?

~~~
karangoeluw
There's no graph.

------
kirtijthorat
Upon clicking the link to your app it gives the following error: An error
occurred in the application and your page could not be served. Please try
again in a few moments. If you are the application owner, check your logs for
details.

~~~
karangoeluw
Yes. Too many requests have resulted in time out error. If you want, you can
run it locally as well:
[https://github.com/karan/HNify#start](https://github.com/karan/HNify#start)

------
karangoeluw
Sorry guys. You people sent so many requests that 1 dyno isn't enough for it.

~~~
shalmanese
A quick performance hack that would help a lot is that you should cache trends
to disk and only generate new trends if the previously generated trends are
too stale.

You're doing a lot of unnecessary computation calculating trends fresh for
every user.

------
karangoeluw
Alright. memcache is in place, and the performance is now phenomenal.

