-
-
Save madsobel/14c6f515aac047831c9fb2dd5e25d303 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
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