Skip to content

Instantly share code, notes, and snippets.

@thebigbad
Created February 24, 2010 22:21
Show Gist options
  • Select an option

  • Save thebigbad/313938 to your computer and use it in GitHub Desktop.

Select an option

Save thebigbad/313938 to your computer and use it in GitHub Desktop.
// our particular spider
var spider = new Spider();
spider.grabber = function ($) {
var urls = [];
$('.post-footer > a:nth-child(2)').each(function (i, node) {
urls.push(node.href);
});
var next_page_button = $('.next_page');
var on_last_page = next_page_button.hasClass('disabled');
var data = {
href: document.location.href,
urls: urls,
on_last_page: on_last_page,
};
return data;
};
spider.go();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment