LastFM - Music Engine (incl. YouTube links)

LastFM - Music Engine (incl. YouTube links)

Looking for a player?

LastFM - Music Engine (incl. YouTube links) - 1

The LastFM Music Engine is an easy lightweight class that makes it simple to integrate and process music info from last fm. The class supports Trending music, Artists search, Track search, Album search & Artist info (toptracks, bio, tags, similar artists).

The class has the following functions:
  • Lightweight class libary (clean, easy to understand code)
  • Return data in 2 lines of code
  • Easy Integration
  • Return Array & HTML
  • Trending music (based on region ISO)
  • Search Artists
  • Search Tracks/Songs
  • Search Albums
  • Artist info (Top Tracks, Bio, Tags, Similar Artists)
  • Ajax Artist/Track & Album search
  • Styled result items included
  • No refresh for search needed
  • Fallback image
  • Update: YouTube link track return
Full demo
Trending music demo
Search for Artist/Track/Album demo
Get info from artist demo

LastFM - Music Engine (incl. YouTube links) - 2

Easy install

- STEP 1 (set your api key)

- STEP 2 (Include & initalize class)
$lstfm = new Lastfm();

Class functions:

$lstfm->trendingTracks('Belgium'); //gets the trending tracks based on a country
$lstfm->trendingArtists('Belgium', 10);  //gets the trending artists based on a country limited to 10 items (limit parameter)
$lstfm->searchTracks('Soldier');  //searchs tracks based on a search term
$lstfm->searchArtists('Marco Bai') //searchs artists based on a search term
$lstfm->searchArtists('Marco Bai', 20) // same with a limit of 20 results
$lstfm->searchAlbums('Half power'); //searchs albums based on the given term
$lstfm->searchArtistInfo('Eminem', array('toptracks', 'bio'));  //gets the toptracks, bio (bio text, tags & similar artists) based on a full artist name
$lstfm->showHtmlList($array, 'type'); //returns an styled unorderd (ul) html list (supports types: artists/tracks/albums)
$lstfm->findVideo("Eminem", "Sing for the moment"); //returns an youtube link based on the given artist & title

Update 29-10-2014

- Youtube API Tracks added