rx0 Posted December 7, 2009 Share Posted December 7, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/ Share on other sites More sharing options...
oni-kun Posted December 7, 2009 Share Posted December 7, 2009 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. } Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/#findComment-972647 Share on other sites More sharing options...
rx0 Posted December 7, 2009 Author Share Posted December 7, 2009 Thanks and it's not a useless function, it's good for any myspace related site to grab the users info. Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/#findComment-972650 Share on other sites More sharing options...
oni-kun Posted December 7, 2009 Share Posted December 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/#findComment-972651 Share on other sites More sharing options...
rx0 Posted December 7, 2009 Author Share Posted December 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/#findComment-972654 Share on other sites More sharing options...
mikesta707 Posted December 7, 2009 Share Posted December 7, 2009 http://wiki.developer.myspace.com/index.php?title=Main_Page They have a several API's, surely one of them would be able to do this Quote Link to comment https://forums.phpfreaks.com/topic/184233-need-big-help-with-php-function/#findComment-972660 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.