Skip to content

Instantly share code, notes, and snippets.

@madsobel madsobel/linkedin-email-extractor.js Secret
Last active Mar 28, 2017

Embed
What would you like to do?
function extractData() {
var emailRegex = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi
var data = [];
$('.feed-s-comment-item__inline-show-more-text').each(function() {
var name = $(this).find('.feed-s-comment-item__name').text()
var comment = $(this).find('.feed-s-comment-item__main-content span span').text().toLowerCase()
var email = comment.match(emailRegex)
if (email) {
data.push({
name: name,
email: email[0]
})
}
})
console.log('Here\'s the data:')
console.log(JSON.stringify(data))
console.log(data.length)
}
if ($('#show_prev').is(':visible')) {
var interval = setInterval(function() {
if (!$('#show_prev').is(':visible')) {
console.log('Im done..');
clearInterval(interval)
extractData()
} else {
console.log('Let\'s click! ');
$('#show_prev').click()
}
}, 2000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.