Created
November 14, 2017 09:17
-
-
Save muka/92b6ebc790ace55f0891a9490957cd80 to your computer and use it in GitHub Desktop.
This file contains 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
var items = [] | |
var read = ()=> { | |
var clr = (s) => s.replace("\n", "").trim() | |
jQuery('.media-body').each((i, el) => { | |
var item = jQuery(el) | |
var url = clr(item.find('h4 a').attr('href').trim()) | |
setTimeout(() => { | |
console.log("item %s : %s", i, url) | |
jQuery.get(url, (response) => { | |
var l = response.match(/ftc\/data\/coop\/\?id\=([0-9]+)/) | |
console.log(l[1]) | |
jQuery.get(l[0], (json) => { | |
items.push([l[0], JSON.stringify(json)]) | |
}) | |
}) | |
}, 1000 * i) | |
}) | |
} | |
var c = 0 | |
var tmr = setInterval(function(){ | |
if(c > 10) { | |
clearInterval(tmr) | |
console.log("done") | |
} | |
read(); | |
jQuery('.pagination:eq(0) li:last a').trigger("click") | |
c++ | |
}, 3000) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment