Skip to content

Instantly share code, notes, and snippets.

@shiondev
Created April 30, 2015 04:04
Show Gist options
  • Select an option

  • Save shiondev/3070b0e0349eb858afbe to your computer and use it in GitHub Desktop.

Select an option

Save shiondev/3070b0e0349eb858afbe to your computer and use it in GitHub Desktop.
URL filter example
this.parseLinks = function(html, url, headers, status, jQuery) {
var app = this;
var $ = jQuery;
var $html = app.parseHtml(html, $);
var links = [];
// gets all links in the html document
$html.find('a').each(function(i, obj) {
// console.log($(this).attr('href'));
var link = app.makeLink(url, $(this).attr('href'));
if (link != null && ((link.indexOf("about-us") > -1) || (link.indexOf("over-ons") > -1)) {
links.push(link);
}
});
return links;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment