Created
April 30, 2015 04:04
-
-
Save shiondev/3070b0e0349eb858afbe to your computer and use it in GitHub Desktop.
URL filter example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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