Array.prototype.forEach.call(document.querySelectorAll('a[href^=user]'),
function(v,k) {
var s = document.createElement("script");
s.src = '//hacker-news.firebaseio.com/v0/user/' + v.innerHTML + '.json?callback=ud_' + k;
document.head.appendChild(s);
window['ud_' + k] = function(user_data){
var avg_karma = user_data.karma / user_data.submitted.length;
v.innerHTML += ' (' + avg_karma.toFixed(1) + ')';
}
}
);Hacker News API
91–100 of 315 posts
Re: Hacker News API
#92Earlier quoted context omitted.
That's two programming languages. Not all languages have a nice ISO-8601 parser built-in. Human-readable is a slight advantage, agreed.
It's not a slight advantage if you've ever had to parse through logfiles by hand or debug APIs with curl--it's a great deal more than that. Why not, let's have some more examples: In PHP (with a bug, because PHP is stupid and doesn't handle decimal fractions): $dateTime = DateTime::createFromFormat( DateTime::ISO8601, '2009-04-16T12:07:23Z'); In C#: DateTime time = DateTime.Parse("2010-08-20T15:00:00Z", null, DateTim…
Funny you should say that, UNIX time works great for log files. Since now even a dumb tool can search for values in the range, 1388491199-1420027199 to see all 2013-2014 lines.
Your way requires specific support for the date format, dealing with "2014" false positives, or searching through all 12 months individually (2013-01, 2013-02, 2013-03, etc).
You keep drumming on about library support, which is important for a format which isn't universally supported. Fortunately for UNIX time there's no value in listing them off one by one, you can just assume it is all of them...
UNIX timestamps are also listed in several international standards. Including POSIX.
Re: Hacker News API
#93This... 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…
This definitely does suck. I feel your pain. But it's also part of the package of scraping websites. You go in knowing that it could break at any time.
Re: Hacker News API
#94Re: Hacker News API
#95This... 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…
just wanted to let you know that I love your application!
Re: Hacker News API
#96This... 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…
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. This definitely does suck. I feel your pain. But it's also part of the package of scraping websites. You go in knowing that it could break at any time.
Re: Hacker News API
#97Re: Hacker News API
#98Re: Hacker News API
#99Re: Hacker News API
#100This... 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…
Thanks very much guys!