Bolovanus Posted February 5, 2014 Report Posted February 5, 2014 salut, am facut un mic script care ia emailurile si nr de tel de pe paginile de fb dupa uidciteste fis uids.txt din acelasi folder unde se afla scriptul.//ex de fisier uids.txt19919323418715143759158337513679797309710230030678728156905524897067237780279101153440891362274602980481673774933201691248744842053503033701864107901540347146396111378830628998682490078521004422161989626574apoi 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 tuscriptul:<?phpfunction 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); }?> Quote
sandabot Posted February 5, 2014 Report Posted February 5, 2014 Ceva care sa ia uid dintr-o lista de prieteni/pagina incarcata nu ai ? Quote
Silviu Posted February 5, 2014 Report Posted February 5, 2014 Pot sa iti spun ca ai muncit de pomana sa faci ditamai carnatul de script care consuma si o gramada de memorie si banda.Solutia light: http://graph.facebook.com/idpagina si extragi frumos din matrice ce ai nevoie. 1 Quote
Bolovanus Posted February 5, 2014 Author Report Posted February 5, 2014 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 Quote
Bolovanus Posted February 5, 2014 Author Report Posted February 5, 2014 (edited) Pot sa iti spun ca ai muncit de pomana sa faci ditamai carnatul de script care consuma si o gramada de memorie si banda.Solutia light: http://graph.facebook.com/idpagina si extragi frumos din matrice ce ai nevoie.da, nu,..experienta..//am sa`l fac cu graph Edited February 5, 2014 by Bolovanus Quote
Silviu Posted February 5, 2014 Report Posted February 5, 2014 da, nu,..experienta..//am sa`l fac cu graphCe 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. Quote
Bolovanus Posted February 5, 2014 Author Report Posted February 5, 2014 am incercat cu graph si din pacate nu arata emailul, ar fi fost mult mai rapid..asta e Quote