Jump to content

Recommended Posts

Hi, first sorry, my English is not so good...

i'm working on a facebook application and i need to match the user id with picture and name from an url like http://www.facebook.com/profile.php?id=1447195962

Tried in many way but i always get just the name instead of the pic and nothing more.

Can someone please help me?

Thanks, this is my code

 

preg_match("/<a id=\href=\"http:\/\/www.facebook.com\..*?id=$fid\">.*?<\s*img [^\>]*src=\"([^\">]+)/is",$hold,$match);
$pic_url = $match[1];
	}
	if(empty($name))
	{
	preg_match("/<span class=\"nametext \">(.*)<\/span>/",$hold,$match);
	$name = $match[1];
	}

	if(empty($name))

	{

	preg_match("/<span class=\"nametext \">(.*)<\/span>/",$hold,$match);

	$name = $match[1];

	}

	if(empty($pic_url))

	{

	$hold=eregi_replace("<img class=\"image \" alt=\"photo\" src=\"","<img border=\"0\" alt=\"\" src=\"",$hold);

$photourl=explode("<img border=\"0\" alt=\"\" src=\"",$hold);$photourl=explode("\"",$photourl[1]);$photourl=$photourl[0];

if(eregi("profile.ak.facebook.com",$hold)) {$photourl=explode("profile.ak.facebook.com",$hold);$photourl=explode("\"",$photourl[1]);$photourl=$photourl[6];}



	$pic_url = $photourl;

	}

Link to comment
https://forums.phpfreaks.com/topic/138583-help-for-preg_match/
Share on other sites

and how is preg_match supposed to extract the information?

if the information isnt in the link u provided?

http://www.facebook.com/profile.php?id=1447195962

 

See no name, just userid

u wuf prolly have to use curl or fopen in order to retrieve the page and parse the page itself, or see if ya can get a redirected url link instead as they do

 

http://it-it.facebook.com/people/Leila-Mod/1447195962

 

which has their name and userid.

 

Link to comment
https://forums.phpfreaks.com/topic/138583-help-for-preg_match/#findComment-724662
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.