Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for sharing this. But why is it a jQuery plugin? It's a single function that iterates over an array, just as suited for a library or node.js module as a webpage; a dependency on a DOM library seems out of place.


There's now a version that doesn't rely on jQuery, thanks for the feedback that led to me doing it :)


Seems to be a wrong approach to me. Instead of using a timestamp it is sorted against 'English' indexof-ed strings. I would expect human-readable date formats are done afterwords on the sorted array itself, which would be a simple compare check.

It is jQuery specific since it uses $.each


I would never make an API that returns time ago and force my users to sort that way. This was made because: http://api.ihackernews.com/page?format=jsonp


Had never seen this unofficial API. Ugh, postedAgo?! Should be a timestamp... As he mentions, it should be avail. Ask ronneroller to change/add it ;-)


You're probably right, this should not depend on jQuery. I'm the most comfortable with it and decided to just roll with it this way. I'll branch out and try making it not dependable on anything other than JavaScript. Thanks for the feedback.


just guessing here: to attract the hordes of "jquery programmers" who don't know how to use a "javascript library"?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: