SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: A little help

  1. #1
    SitePoint Member SPTony's Avatar
    Join Date
    Sep 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A little help

    I need some help...

    this code gets image from myspace.. i want it to get their display image... but its kind of hard to do... because if someones image on your page(a friend) with an extension other than yours it shows thier pic not yours... maybe you will understand what i mean..


    PHP Code:
    // Get Display Name from myspace thing
    $DisplayPicture=file_get_contents("http://myspace.com/$FriendID");
    preg_match("!<img src=\"http://myspace([^>]*)_m.jpg!is",$DisplayPicture,$DisplayPicMatches);$Picurl $DisplayPicMatches[1]; 
    $PicLocation "http://myspace".$Picurl."_m.jpg";

    // If that picture doesnt show up then
    if(!$Picurl){
    // check see if its a gif
    $DisplayPicture=file_get_contents("http://myspace.com/$FriendID");
    preg_match("!<img src=\"http://myspace([^>]*)_m.gif!is",$DisplayPicture,$DisplayPicMatches);
    $Picurl $DisplayPicMatches[1]; 
    $PicLocation "http://myspace".$Picurl."_m.gif";
    }

    // If that picture doesnt show up then
    if(!$Picurl){
    // check see if its a gif
    $DisplayPicture=file_get_contents("http://myspace.com/$FriendID");
    preg_match("!<img src=\"http://a([^>]*).jpg!is",$DisplayPicture,$DisplayPicMatches);
    $Picurl $DisplayPicMatches[1]; 
    $PicLocation "http://a".$Picurl.".jpg";
    }
    if(!
    $Picurl){
    // check see if its a gif
    $DisplayPicture=file_get_contents("http://myspace.com/$FriendID");
    preg_match("!<img src=\"http://a([^>]*).gif!is",$DisplayPicture,$DisplayPicMatches);
    $Picurl $DisplayPicMatches[1]; 
    $PicLocation "http://a".$Picurl.".gif";


  2. #2
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At first, you (or someone else here, who has dealt with MySpace) will have to determine the criteria which defines what of the <img /> tags in the HTML is the display image, and after that, we will be able to help you with the code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •