Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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