Skip to content

Instantly share code, notes, and snippets.

@ericclemmons
Created March 7, 2011 01:32
Show Gist options
  • Save ericclemmons/857947 to your computer and use it in GitHub Desktop.
Save ericclemmons/857947 to your computer and use it in GitHub Desktop.
Example recipe for adding "infinite scroll" to Hackernews
// README: https://github.com/ericclemmons/de-pagify
//
// Step 0 - Visit http://news.ycombinator.com/
// Step 1 - Inject jQuery (http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet)
// Step 2 - Inject De-Pagify (https://github.com/ericclemmons/de-pagify/raw/master/bookmarklet.jquery.min.js)
// Step 3 - Run the following in the console:
jQuery('td > table:eq(1)').depagify('td.title:last a', {
filter: 'tr',
threshold: 'td.title:last a',
effect: function() {
jQuery(this).fadeIn();
},
events: {
request: function() {
jQuery('tr:last', this).remove();
}
}
});
// Step 4 - Now scroll down to the "More" link for content to automatically load!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment