Skip to content

Instantly share code, notes, and snippets.

@muka
Created November 14, 2017 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muka/92b6ebc790ace55f0891a9490957cd80 to your computer and use it in GitHub Desktop.
Save muka/92b6ebc790ace55f0891a9490957cd80 to your computer and use it in GitHub Desktop.
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