Skip to content

Instantly share code, notes, and snippets.

@paoga87
Created September 21, 2016 16:00
Show Gist options
  • Save paoga87/1895ce174cbadf1408358cb8f4d8f450 to your computer and use it in GitHub Desktop.
Save paoga87/1895ce174cbadf1408358cb8f4d8f450 to your computer and use it in GitHub Desktop.
//Javascript hack from Fullstack Lesson #1: Javascript Craigslist for Fun and Profit
var emails = "";
$(".txt").find("a.hdrlnk").map(function(i, el) { return el })
.each(function(i, el) {
$.get(el.href, function(body) {
$.get( $(body).find("#replylink")[0].href, function(linkbody) {
var email = $(linkbody).find('a[href^="mailto:"]')[0].innerText + ',';
emails += email;
})
})
})
setTimeout(function() {
console.log('emails: ' + emails);
}, 5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment