Jump to content
Bolovanus

[get] Fb get lead from uid

Recommended Posts

Posted

salut, am facut un mic script care ia emailurile si nr de tel de pe paginile de fb dupa uid

citeste fis uids.txt din acelasi folder unde se afla scriptul.

//ex de fisier uids.txt

199193234187
151437591583375
136797973097
102300306787
281569055248970
672377802791011
53440891362
27460298048
167377493320169
124874484205350
303370186410790
154034714639611
1378830628998682
490078521004422
161989626574

apoi salveaza pagina + email + nr tel

//daca nu gaseste email pe pagina nu o mai salveaza, nu mai are rost

//ex de fisier cu rezultate:

https://www.facebook.com/ClubPranaPage => email:club@clubprana.com phone:+1 813-241-4139 
https://www.facebook.com/amptampa => email:info@amptampa.com phone:+
https://www.facebook.com/liquidtampa => email:LIQUIDTAMPA@GMAIL.COM phone:+
https://www.facebook.com/elpalladium.tampa => email:palladiumtampa@gmail.com phone:+1 813-354-1106
https://www.facebook.com/pages/Honey-Pot/27460298048 => email:esw2035@hotmail.com phone:+
https://www.facebook.com/TheGoldClubTampa => email:gctpa@yahoo.com phone:+1 813-622-7899
https://www.facebook.com/pages/Til-Dawn/160729313988764 => email:tildawn813@gmail.com phone:+1 813-842-4290
https://www.facebook.com/odysseytampa => email:Jim@2001NUDE.com phone:+1 813-877-6406
https://www.facebook.com/pages/BRASS-MUG/134719499887538 => email:brassmugbooking@yahoo.com phone:+1 813-972-8152
https://www.facebook.com/skintampa => email:manager@skintampa.com phone:+1 813-242-9600

//la ce foloseste? si cum te`ar ajuta? plm vezi tu

scriptul:


<?php

function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}

function get_page( $url ) {
$res = array();
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0",
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 120,
CURLOPT_TIMEOUT => 120,
CURLOPT_MAXREDIRS => 10,
);
$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );

$res['content'] = $content;
$res['url'] = $header['url'];
return $res;
}

function get_lead($page,$link,$uid){

if(strpos($page['url'],"pages") !== false)
{

$page = get_page($link."?id=".$uid."&sk=info");
$page = $page['content'];
$email = get_string_between($page, "mailto:", "\">");
if($email === ""){return;}
$phone = get_string_between($page, "\">+", "</td>");
$data = "$link => email:$email phone:+$phone \n";
file_put_contents('leads.txt', html_entity_decode($data), FILE_APPEND);
}
else
{
$page = get_page($link."/info");
$page = $page['content'];
$email = get_string_between($page, "mailto:", "\">");
if($email === ""){return;}
$website = get_string_between($page, "<a href=\"", "/\" target=\"");
$phone = get_string_between($page, "\">+", "</td>");
$data = "$link => email:$email phone:+$phone \n";
file_put_contents('leads.txt', html_entity_decode($data), FILE_APPEND);
}
}


$uids = file_get_contents('uids.txt');
$uids = explode("\n",$uids);

foreach($uids as $uid)
{

$page = get_page("https://www.facebook.com/".$uid);

$link = $page['url'];

get_lead($page,$link,$uid);
}

?>

Posted
Ceva care sa ia uid dintr-o lista de prieteni/pagina incarcata nu ai ? :)

am, dar e in zenno..am sa incerc sa fac..eu mai mult ma folosesc de places si ala e mai greu de scrapat, asa pt prieteni si fani si pagini normale am un script in js il fol in chrome ca plugin

Posted
da, nu,..experienta..

//am sa`l fac cu graph

Ce iti returneaza graph.facebook.com este in format JSON. Te sfatuiesc sa citesti aici PHP: json_decode - Manual apoi sa folosesti o functie curl simpla care sa iti preia continutul, sa faci un json_decode variabilei si apoi sa accesezi obiectele/elementele matricilor de care ai nevoie.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...