https://github.com/rtuin/lastfmservice
A library for use with the Last.fm API.
https://github.com/rtuin/lastfmservice
Last synced: over 1 year ago
JSON representation
A library for use with the Last.fm API.
- Host: GitHub
- URL: https://github.com/rtuin/lastfmservice
- Owner: rtuin
- Created: 2011-11-11T20:36:03.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-11-11T21:22:52.000Z (over 14 years ago)
- Last Synced: 2025-01-21T02:42:46.861Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 125 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Lastfm API wrapper for PHP 5.3
This is a (generated) library for use with the Last.fm API. It is for general use, and should cover the entire Last.fm API.
## Example
The library is designed to be slim and simple. In fact it is just a wrapper to the API. The results you receive from the
API calls are instances of `SimpleXmlElement`. This is on purpose as the `SimpleXmlElement` classes allow for easy traversing
over the data and even query against it.
A simple code example is the following:
// This code sample queries the Last.fm Album.getInfo method
// Preconfigure the client
$apiKey = 'yourapikey';
$client = new Lastfm\Service\Client($apiKey);
// Instantiate an instance of the service subset (or entity if you like)
$album = new Lastfm\Service\Album($client);
// The actual query to the API
$result = $album->getInfo('On the go', 'Matthew Halsall');
## Thoughts and wishlist
The library is generated from the documentation that is available [here](http://www.last.fm/api), and there is still
some manual work to do.
As i've just needed a relatively small portion of the library for the project i'm working on, there are just
some unit tests for the sake of it, not for every part of the library.
Also, it would be nice to see the `Client` class remember authentication tokens etc.
Another thing that is worth looking at is the client `httpRequest` method; not sure if CURL is the way to go.