Convert Facebook uid into Facebook username!

Status
Not open for further replies.

sexaku

Newbie
Joined
Jan 5, 2014
Messages
2
Reaction score
0
Hi guys,
I've been lurking here for some time now, time to share something with the community.
Note: you may increase maximum execution time on your webserver if you wanna convert long lists.
Have fun guys!
UPDATE: sorry, i cant post the code here for gods sake, the php code triggered some moderation system, im uploading it to pastebin rn.
pastebin id: gAGndbzs
 
Last edited:
Hmm post pastebin then. It's not the right forum though. Try programming section.

OP's snippet on Pastebin:
All credits to him :-)
Code:
<?php
$lines=array();
$fp=fopen('file.txt', 'r');
while (!feof($fp))
{
    $line=fgets($fp);
    $line=trim($line);
    $lines[]=$line;

 
}
fclose($fp);
 
$n = 0;
while ($n < count($lines)){
    $response = file_get_contents('http: slash slash graph dot facebook dot com/'.$lines[$n]);
    $array = json_decode($response, true);
 
    
 
    $file = 'address.txt';
    // Open the file to get existing content
    $current = file_get_contents($file);
    // Append a new person to the file
    if (empty($array['username'])) {
       $current .= $array['id']." AT facebook dot com"."\r\n";;
    }
    else {
       $current .= $array['username']." AT facebook dot com"."\r\n";
    }
    
    // Write the contents back to the file
    file_put_contents($file, $current);
    $n = $n + 1;
    }
?>
 
Last edited:
Status
Not open for further replies.
Back
Top