This API will construct the appropriate Last.fm API URL to query, and use RequestCore and SimpleXML to retrieve and parse the data.
Because of the way that Last.fm handles authenticated requests, no extra work needs to be done at the API-level to support these requests. You will, however, need to manage your authentication tokens in your app as this API doesn’t (and shouldn’t) do that.
- PHP 5.2
- cURL
- SimpleXML
- RequestCore
- CacheCore (Optional)
You can rename config-sample.inc.php
to config.inc.php
and add your key/secret there, or you can pass your key/secret key to the constructor.
I would recommend the former over the latter if you generally only use on key/secret set.
If you want to make a request to Last.fm’s album.getInfo
method for Motion City Soundtrack’s “Even If It Kills Me” album, you’d do the following:
This code is Copyright © 2009, Ryan Parman. However, I’m licensing this code for others to use under the Simplified BSD license.