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!


Results 1 to 5 of 5

Thread: PHP GD and XML?

  1. #1
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default PHP GD and XML?

    Hey

    Right, well I am trying to create a dynamic signature for myself using the Last.FM API and PHP GD.

    I'm wanting it to show the most recent track played, and that is outputted in XML but I don't know how to go from the XML to it then being put into the PHP GD and then outputted?

    All help appreciated! (Sorry if its not described too well lol)

  2. #2
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    Quote Originally Posted by Johno! View Post
    Hey

    Right, well I am trying to create a dynamic signature for myself using the Last.FM API and PHP GD.

    I'm wanting it to show the most recent track played, and that is outputted in XML but I don't know how to go from the XML to it then being put into the PHP GD and then outputted?

    All help appreciated! (Sorry if its not described too well lol)
    I don't know any PHP/XML Integration but you could use

    file_get_contents('www.site.com/lol.xml');

    and explode the tags containing the info you want to display.

  3. #3
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    When I use file_get_contents, I get this output shown on this page http://johnathanlaw.com/sig2.php

    Now how do I use explode to get the data I want from that?

  4. #4
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Do:
    PHP Code:
    $xml_file file_get_contents('www.site.com/lol.xml');
    $name preg_match'#<name>(.*?)</name>#'$xml_file$matches );
    $name $matches]; 
    to parse the name of the song. Hopefully that'll work & get you started

  5. #5
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    Thank yoooou +rep to you both

    Gotta spread before I can give it to you again Simon

    Thread Closed
    Last edited by Johno; 19-10-2008 at 11:27 AM.

Posting Permissions

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