KethiLastFm is a PHP class designed to allow you easy access to Last.fm's user profile API for use on your website. Just download my PHP class, include it into your existing website, supply your username, and call the draw_latest_ten_tracks() method. Apply any optional CSS to the markup that you'd like, then you're done!
Download
Example code
<?php
require_once('inc/kethilastfm.inc.php'); // include kethilastfm
$kethilastfm = new kethilastfm('kethinov'); // instantiate it with your last.fm username
$kethilastfm->draw_latest_ten_tracks(); // show last ten tracks you listened to
?>
Sample CSS (optional)
.kethilastfm li strong {font-weight:normal;}
.kethilastfm li em {float:right;font-style:normal;color:#909090;}
.kethilastfm li span {display:none;}
Live demo: the last ten tracks I've listened to
- 16 hours, 14 minutes ago: A Perfect Circle – Weak And Powerless(Tilling My
- 16 hours, 19 minutes ago: A Perfect Circle – The Outsider(Apocalypse Mix)
- 16 hours, 24 minutes ago: A Perfect Circle – 3 Libras(Feel My Ice Dub Mix)
- 17 hours, 5 minutes ago: A Perfect Circle – Judith(Renholder Mix)
- 17 hours, 7 minutes ago: A Perfect Circle – Over
- 17 hours, 12 minutes ago: A Perfect Circle – Breña
- 17 hours, 16 minutes ago: A Perfect Circle – Thinking Of You
- 17 hours, 19 minutes ago: A Perfect Circle – Renholdër
- 17 hours, 22 minutes ago: A Perfect Circle – Thomas
- 17 hours, 27 minutes ago: A Perfect Circle – Sleeping Beauty
powered by KethiLastFm by Eric Newport
Licensing
KethiLastFm is licensed under the Creative Commons Attribution 3.0 United States License. You are permitted to redistribute and/or modify this work for commercial or noncommercial purposes provided proper attribution to the original author (me) is present in the redistribution.
