Last active
January 4, 2016 07:59
-
-
Save sters/8592787 to your computer and use it in GitHub Desktop.
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
| (function(){ | |
| var urlRegExp = [/.+/, /.+/]; | |
| var outputs = []; | |
| var ifrm = $("<iframe>").appendTo($("body")); | |
| var lists = $("a").filter(function(i){ | |
| return | |
| $(this).attr("target") == "_blank" && | |
| $(this).attr("href").match(urlRegExp[0]); | |
| }); | |
| var index = 0, max = lists.length; | |
| var next = function(){ | |
| if(index > max) { | |
| document.write(""); | |
| outputs.forEach(function(item){ | |
| document.write(item + "<br>"); | |
| }); | |
| return; | |
| } | |
| var _this = lists.eq(index); | |
| ifrm.attr("src", _this.attr("href")); | |
| location.hash = index + "_:_" + max; | |
| index++; | |
| }; | |
| ifrm.load(function(){ | |
| ifrm.contents().find("a").filter(function(i){ | |
| return | |
| $(this).attr("target") == "_blank" && | |
| $(this).attr("href").match(urlRegExp[1]); | |
| }).each(function() { | |
| outputs.push($(this).attr("href")); | |
| setTimeout(next, 3000); | |
| }); | |
| }); | |
| next(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment