treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] PHP last.fm API wrapper

  • I've been trying to integrate an API stream from Last.fm onto a webpage (http://www.liamjaydesigns.com/LJ_new_portfolio_site/last_fm_test.php).

    I'm using a PHP last.fm API wrapper from http://source.aelabs.net/last/.

    I managed to get the default example working just fine, but I do not want the name of the song or the artists to appear. Instead I just want the album covers to show up. I've managed to change the code to achieve this, but my problem is that the album covers URL's include my own website address before their own so none of the links work.

    How do I make the URL links ignore my own website?
    Do I have to change something on the "lfmfuncs.php" file?
  • Simply add "http://" to the front of each link.
  • Thanks but the trouble is that all the links are dynamical generated so I can't just add http:// to them as all that appears on each page is a [url] tag.
    However I tried adding "http://" before the [url] tag and it now works for all links that the tag generates so problem is now sorted.

    Thanks very much for your help and advice.