preg_matching on facebook profile.php [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this questionhow to grab facebook username? using preg_matching?
this is my sample code!
<?php
$page = file_get_contents("http://www.facebook.com/profile.php");
$username = preg_match('/<meta http-equiv=refresh content="0; URL=^[A-Za-z0-9]+$/', $page, $matches) ? $matches[1]: '/djmardagz?_fb_noscript=1';
echo $username;
?>
开发者_C百科
that's my idea, but it's not working, whew anyone know how to grab facebook username? like for example: you visit my site, after that i got your facebook username....
so how was it done? anyone know? please share :)
The only possible way to do that is if you get a referrer back to a url like :
facebook.com/profile.php?id=....
Then, you can quite easily parse the url and get more information on the user. But if you do not have that information, it's not possible to do so.
It's quite easy to then parse the url using curl and reg matching.
精彩评论