Jump to content

Need big help with php function


rx0

Recommended Posts

I'm trying to code a php function that grabs a myspace users default picture url & display name & stores it in 2 variables from their myspace with their id so that the function is executed in this format:

GrabInfo(myspace id here);

 

but I don't know regex nor how to use cURL or any other remote grabbing method, ideas?

Link to comment
Share on other sites

I'm trying to code a php function that grabs a myspace users default picture url & display name & stores it in 2 variables from their myspace with their id so that the function is executed in this format:

GrabInfo(myspace id here);

 

but I don't know regex nor how to use cURL or any other remote grabbing method, ideas?

 

I doubt anyone will write such a pointless function, but you can start with a regex tutorial here:

http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html

 

And here's a start to your function:

function GrabInfo($myspaceID) {
   $contents = file_get_contents('http://www.myspace.com/users/' . $myspaceID); //Or wherever myspace users are..
   preg_match('#profi....'); //The fun part!, you can match off $contents which is the source of the myspace page.
}

Link to comment
Share on other sites

Thanks and it's not a useless function, it's good for any myspace related site to grab the users info.

 

There might be code people have already written out in the wild, Or even an API. I'd google it. I'm sure there's info on how to get user info online.

Link to comment
Share on other sites

Thanks and it's not a useless function, it's good for any myspace related site to grab the users info.

 

There might be code people have already written out in the wild, Or even an API. I'd google it. I'm sure there's info on how to get user info online.

I've looked around nothing relevant, all old code the regex functions need to be rewritten in them because of the way myspace have changed the way images are placed.

Link to comment
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.