Integration

Follow this guide if you want to integrate this with an existing script

Step 1

Head over to the Last.fm site and apply for an API account, really easy to sign up and I got a key straight away.

Step 2

Using the provided schema.sql file in the download create the database and appropriate tables, if your hosting provider creates the database for you just use the statements to create the tables

Step 3

Open up the php/config.inc.php file and insert your database and Last.fm API keys:

// define database settings
define('HOSTNAME','localhost');
define('DB_USERNAME','DATABASE_USERNAME_GOES_HERE');
define('DB_PASSWORD','DATABASE_PASSWORD_GOES_HERE');
define('DB_NAME','song_requests');

// defin Lastfm settings
define('LASTFM_API_KEY','KEY_GOES_HERE');
define('LASTFM_SECRET_KEY','KEY_GOES_HERE');

Step 4

Copy over the css, imgs, js & php folders and include the following CSS & Javascript files in your HTML:

Step 5

Include the config PHP file at the very top of the page you want the track request to appear:

require "php/config.inc.php";

Step 6

Finally copy & paste the following HTML onto the page you want the track request: