Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 53
  1. #11
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Warning: file_get_contents(http://www.last.fm/music/Boys Like Girls) [function.file-get-contents]: failed to open stream: HTTP request failed! in /home/skylight/public_html/testalbum.php on line 5

  2. #12
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Luckyrare View Post
    Well this is how you would do it... (Would be a picture of the artists)

    -> Get artist name
    -> Get files contents of the artist - http://www.last.fm/music/artist

    You would have to replace a space with a "+"

    eg) http://www.last.fm/music/U2

    -> Get the content of
    HTML Code:
    <div class="imgHolder"></div>
    using eregi

    Good luck
    so i have to add each band/artist manually

    isnt there a simpler code to just stick into the stats so it grabs it from the sound file playing because SAM can read it :S
    EDTALKING


  3. #13
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Just get the artist out of the Now Playing (try exploding by " - " and then using $variable[0] to get the artist name) and then just put that into the URL you want to query.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  4. #14
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    i have mine working but it always adds &#37;20's and never works. And with URL Decode it messes up

  5. #15
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    I have this working with spaces etc.

    http://thomas.uk.to/artist.php?artist=The Fratellis

    PHP Code:
    <?php
    $artist 
    $_GET['artist'];

    $artist urldecode($artist);

    $url "http://www.last.fm/music/" $artist "/";
    $url eregi_replace(" ""+"$url);

    $data file_get_contents($url);

    $image1start explode('<div class="imgHolder">'$data);
    $image1end explode('</div>'$image1start[1]);
    $image1 trim($image1end[0]);

    $imagestart explode('<img src="'$image1);
    $imageend explode('" alt'$imagestart[1]);
    $image trim($imageend[0]);

    echo 
    '<img src="' $image '">';

    ?>
    Doesnt make the page an image using GD though.

    I have also made one to recieve the artists latest album.

    http://thomas.uk.to/album.php?artist=The Fratellis

    PHP Code:
    <?php
    $artist 
    $_GET['artist'];

    $artist urldecode($artist);

    $url "http://www.last.fm/music/" $artist "/+albums?order=date";
    $url eregi_replace(" ""+"$url);

    $data file_get_contents($url);

    $image1start explode('<div class="cover">'$data);
    $image1end explode('</div>'$image1start[1]);
    $image1 trim($image1end[0]);

    $imagestart explode('<img src="'$image1);
    $imageend explode('" alt'$imagestart[1]);
    $image trim($imageend[0]);

    echo 
    '<img src="' $image '">';

    ?>
    Last edited by ZAG; 16-02-2007 at 04:39 PM.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  6. #16
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default




    PHP Code:
    <?php
    header
    ("Content-Type: image/gif");
    $artist $_GET['artist'];

    $artist urldecode($artist);

    $url "http://www.last.fm/music/" $artist "/";
    $url eregi_replace(" ""+"$url);

    $data file_get_contents($url);

    $image1start explode('<div class="imgHolder">'$data);
    $image1end explode('</div>'$image1start[1]);
    $image1 trim($image1end[0]);

    $imagestart explode('<img src="'$image1);
    $imageend explode('" alt'$imagestart[1]);
    $image trim($imageend[0]);
    $image2 imagecreatefromjpeg($image);
    imagegif($image2);

    ?>

  7. #17
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    There you go

    Wish last.fm wasnt so slow though

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  8. #18
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Yea but it gets used alot so it takes a while.

    =[

    How can I explode: Dawn of the Dude - Set Us Free

    into just Dawn of the Dude?
    Last edited by Dentafrice1; 16-02-2007 at 04:49 PM.

  9. #19
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php
    $song_data 
    "Dawn of the Dude - Set Us Free";
    $song_data_exploded explode(" - "$song_data);
    ?>



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  10. #20
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Quote Originally Posted by NintendoNews View Post
    PHP Code:
    <?php
    $song_data 
    "Dawn of the Dude - Set Us Free";
    $song_data_exploded explode(" - "$song_data);
    ?>
    Then you could echo is out using

    PHP Code:
    echo $song_data_exploded[0]; 

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

Page 2 of 6 FirstFirst 123456 LastLast

Posting Permissions

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