<?php
require "autoloader.php";
use LastFm\Src\Caller\CallerFactory as CallerFactory;
use LastFm\Src\Artist as Artist;
// set api key
CallerFactory::getDefaultCaller()->setApiKey('<Your API key>');
// search for the Coldplay band
$artistName = "Linkin Park";
$tracks = Artist::getTopTracks($artistName);
$results = [];
foreach ($tracks as $key => $track) {
$results[] = [
'name' => $track->getName(),
'played' => $track->getPlayCount(),
'url' => $track->getUrl()
];
}
echo json_encode($results);
?>
-
Notifications
You must be signed in to change notification settings - Fork 0
Last.fm API Library in PHP
License
Hemant-Mann/LastFm
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Last.fm API Library in PHP
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published