Jump to content

Grab last listened last.fm track from rss feed


maczaaron

Recommended Posts

I am trying to make an image with php that overlays my last played last.fm track (accessible via the rss feed://ws.audioscrobbler.com/1.0/user/theusernamehere/recenttracks.rss) onto a static image, background.

 

I am very new to php, and have a starting point:

<?php
$myimage = imagecreatefrompng ( "mytemplate.png" );
$text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
imagestring( $my_img, 4, 30, 25, "thesitewizard.com",
  $text_colour );
imagesetthickness ( $my_img, 5 );

header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $text_color );
imagedestroy( $my_img );
?>

 

Now, instead of the text there right now, how can I make it grab the last played track from that rss feed and display it on the image (in the imagestring)?

 

Thanks for any help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.