5 ms·
Hacker News Trends
- karangoeluw 13y agoAPI source: https://github.com/karan/HNify https://github.com/karan/HNify
- xux 13y agowhat framework are you using to render the graph?
- karangoeluw 13y agoThere's no graph.
- kirtijthorat 13y agoUpon 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 13y agoYes. 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
- sant0sk1 13y agoNot 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
- xerophtye 13y agoI am unable to get it to work... No matter what i enter, i end up with an empty graph. even when i wrote "NSA" and "Edward Snowden"
- maxmcd 13y agoOk, the graph animation is cool, an actually helps give a sense of scale, but after 2-3 searches it gets incredibly tedious. Apologies if there's some kind of skip functionality that I'm missing.
- karangoeluw 13y agoIt's back up. I had to restart the server: http://hnify.herokuapp.com/get/trends http://hnify.herokuapp.com/get/trends
- RK 13y agoInteresting 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 13y agoI quite like this one http://hntrends.jerodsanto.net/?q=%22written+in+go%22 http://hntrends.jerodsanto.net/?q=%22written+in+go%22
- karangoeluw 13y agoSorry guys. You people sent so many requests that 1 dyno isn't enough for it.
- shalmanese 13y agoA 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 13y agoOk 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
- dylandrop 13y agoPersonally 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 13y agoYou'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.
- deleted 13y ago[deleted]
- dylandrop 13y agoPerhaps 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 13y agoThat's a good idea. I'll definitely work on making the API faster.
- karangoeluw 13y agoAlright. memcache is in place, and the performance is now phenomenal.