Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Email Information Gathering in Post Linkedin
<?php
$targets = array_unique(explode("\n",file_get_contents("posts.targets")));
$user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0';
foreach ($targets as $key => $url_target) {
#REQUEST PEGANDO ID
exec("curl -kg --user-agent '{$user_agent}' '{$url_target}'>tmp");
#GREP ID
$data_article_permalink = 'cat tmp | grep -oP \'(?<=data-article-permalink=").*?(?=">)\'';
$data_article_urn = 'cat tmp | grep -oP \'(?<=data-article-urn="urn:li:article:).*?(?=")\'';
$return[] = exec("{$data_article_urn}");
$return[] = exec("{$data_article_permalink}");
#SLEEP
$sleep = random_int(1,5);
sleep($sleep);
#URL REQUEST
$url_request_dump_email = "https://www.linkedin.com/content-guest/article/comments/urn%3Ali%3Aarticle%3A{$return[0]}?count=100&start=0&articlePermalink={$return[1]}";
$file_dump_html = "dump_html_tmp_{$return[0]}";
$file_dump_email = "emails_{$return[0]}";
#REQUEST URL COMENTÁRIOS
exec("curl -kg --user-agent '{$user_agent}' '{$url_request_dump_email}'>'{$file_dump_html}'");
#GREP EMAILS
exec('cat "'.$file_dump_html.'" | grep -E -o \'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b\' | sort | uniq >'.$file_dump_email);
echo " DUMP HTML: {$file_dump_html} \n EMAIL: {$file_dump_email}\n URL: {$url_request_dump_email}\n\n";
$log = "\n-------------------------------------------\n";
$log.= "\nDATA:".date('d-m-Y H:i:s');
$log.= "\nURL:".$url_request_dump_email;
$log.= "\n-------------------------------------------\n";
file_put_contents("{$file_dump_email}",$log,FILE_APPEND);
#SLEEP
sleep($sleep);
unset($return);
}
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.