Created
September 21, 2016 16:00
-
-
Save paoga87/1895ce174cbadf1408358cb8f4d8f450 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
//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