nucleos / lastfm
Last.fm webservice client for php.
Fund package maintenance!
core23
Opencollective
Ko-Fi
Other
Installs: 11 311
Dependents: 2
Suggesters: 0
Security: 0
Stars: 14
Watchers: 2
Forks: 5
Open Issues: 3
Requires
- php: ^8.1
- ext-json: *
- ext-mbstring: *
- ext-pcre: *
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0 || ^2.0
- psr/log: ^1.0 || ^2.0 || ^3.0
- symfony/css-selector: ^6.4 || ^7.0
- symfony/dom-crawler: ^6.4 || ^7.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.0.1
- nyholm/psr7: ^1.0
- symfony/http-client: ^6.4 || ^7.0
Suggests
- symfony/http-client: Symfony HTTP client implementation
This package is auto-updated.
Last update: 2024-12-13 08:47:02 UTC
README
This library provides a wrapper for using the Last.fm API inside PHP.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:
composer require nucleos/lastfm
# To define a default http client and message factory
composer require symfony/http-client nyholm/psr7
Usage
// Create connection use Nucleos\LastFm\Service\AuthService; use Nucleos\LastFm\Service\ChartService; use Nucleos\LastFm\Service\PsrClientConnection; $connection = new PsrClientConnection($httpClient, $requestFactory); // Auth user to get a token // http://www.last.fm/api/auth/?api_key=API_KEY // Create a session (with generated token) $token = 'API token'; $authApi = new AuthService($connection); $session = $authApi->createSession($token); $chartApi = new ChartService($connection); $tags = $chartApi->getTopTags(10);
Limitations
Last.fm removed some of their favorite APIs due their relaunch in March 2016. Some of the following removed methods are available via a webcrawler. Please have a look at the Nucleos\LastFm\Crawler
package.
Album
album.getBuylinks
album.getShouts
album.share
Artist
artist.getEvents
artist.getPastEvents
artist.getPodcast
artist.getShouts
artist.getTopFans
artist.share
artist.shout
Chart
chart.getHypedArtists
chart.getHypedTracks
chart.getLovedTracks
Event
event.attend
event.getAttendees
event.getInfo
event.getShouts
event.share
event.shout
Geo
geo.getEvents
geo.getMetroArtistChart
geo.getMetroHypeArtistChart
geo.getMetroHypeTrackChart
geo.getMetroTrackChart
geo.getMetroUniqueArtistChart
geo.getMetroUniqueTrackChart
geo.getMetroWeeklyChartlist
geo.getMetros
Group
group.getHype
group.getMembers
group.getWeeklyAlbumChart
group.getWeeklyArtistChart
group.getWeeklyChartList
group.getWeeklyTrackChart
Library
library.addAlbum
library.addArtist
library.addTrack
library.getAlbums
library.getTracks
library.removeAlbum
library.removeArtist
library.removeScrobble
library.removeTrack
Playlist
playlist.addTrack
playlist.create
Radio
radio.getPlaylist
radio.search
radio.tune
Tag
tag.getWeeklyArtistChart
tag.search
Tasteometer
tasteometer.compare
tasteometer.compareGroup
Track
track.ban
track.getBuylinks
track.getFingerprintMetadata
track.getShouts
track.getTopFans
track.share
track.unban
User
user.getArtistTracks
user.getBannedTracks
user.getEvents
user.getNeighbours
user.getNewReleases
user.getPastEvents
user.getPlaylists
user.getRecentStations
user.getRecommendedArtists
user.getRecommendedEvents
user.getShouts
user.shout
user.signUp
user.terms
Venue
venue.getEvents
venue.getPastEvents
venue.search
License
This library is under the MIT license.