-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrote the readme in markdown, cause textile sucks
- Loading branch information
Showing
1 changed file
with
38 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,85 @@ | ||
h1. LastFm | ||
# LastFm | ||
|
||
This library provides some a Ruby interface to interact with the LastFM API. For the time being you can only get data from LastFm. | ||
This library provides some a Ruby interface to interact with the Last.fm API. For the time being you can only get data from Last.fm. | ||
|
||
First of all I would like to thank ("gordonbisnor":http://github.com/gordonbisnor/) for his "Rails plugin":http://github.com/gordonbisnor/lastfm on which I started building. I started writing this library as I was not satisfied with existing Ruby clients for LastFm. This project is far from being complete and it is not well tested but works quite well for my current project. The reason for writing this library is that most of the existing clients were not Rubyish enough and were tightly attached to Rails. In order to start using this library be sure you have a "LastFm API":http://www.last.fm/api api and secret key. | ||
First of all I would like to thank [gordonbisnor][gordon] for his [Rails plugin][plugin] on which I started building. I started writing this library as I was not satisfied with existing Ruby clients for Last.fm. This project is far from being complete and it is not well tested but works quite well for my current project. The reason for writing this library is that most of the existing clients were not Rubyish enough and were tightly attached to Rails. In order to start using this library be sure you have a [Last.fm API][api] key and secret key. | ||
|
||
h2. Installation | ||
|
||
h4. Gem install | ||
## Installation | ||
|
||
@sudo gem install lastfm@ | ||
### Gem install | ||
|
||
sudo gem install last_fm | ||
|
||
Then in your code require it as | ||
|
||
@require 'last_fm'@ | ||
require 'last_fm' | ||
|
||
|
||
h2. Example | ||
## Examples | ||
|
||
Load your configuration | ||
|
||
@LastFm.load_configuration(your_api_key, your_secret+key)@ | ||
LastFm.load_configuration(your_api_key, your_secret+key) | ||
|
||
Get information for an artist | ||
|
||
@artist = LastFm::Artist.new('Pink Floyd')@ | ||
artist = LastFm::Artist.new('Pink Floyd') | ||
|
||
See the attributes for the artist object | ||
|
||
@artist.methods@ | ||
artist.methods | ||
|
||
Get an album of this artist | ||
|
||
@artist.album('The Wall')@ | ||
artist.album('The Wall') | ||
|
||
Get a track of this artist | ||
|
||
@a.track('High Hopes')@ | ||
artist.track('High Hopes') | ||
|
||
Get an album | ||
|
||
@LastFm::Album.new('Bonobo','Animal Magic')@ | ||
|
||
@LastFm::Album.search('Bonobo','Animal Magic')@ | ||
|
||
@LastFm::Artist.search('Bonobo').album('Animal Magic')@ | ||
LastFm::Album.new('Bonobo','Animal Magic') | ||
LastFm::Album.search('Bonobo','Animal Magic') | ||
LastFm::Artist.search('Bonobo').album('Animal Magic') | ||
|
||
Get a track | ||
|
||
@LastFm::Track.new('Bonobo','Silver')@ | ||
LastFm::Track.new('Bonobo','Silver') | ||
LastFm::Track.search('Bonobo','Silver') | ||
LastFm::Track.search('Bonobo').album('Silver') | ||
|
||
@LastFm::Track.search('Bonobo','Silver')@ | ||
Get user information | ||
|
||
@LastFm::Track.search('Bonobo').album('Silver')@ | ||
LastFm::User.new('p3010010').top_albums | ||
|
||
Get user information | ||
|
||
@LastFm::User.new('p3010010').top_albums@ | ||
## Dependencies | ||
|
||
h2. Dependencies | ||
The only requirement is ActiveSupport. | ||
|
||
The only requirement is ActiveSupport | ||
|
||
h2. Notes | ||
## Notes | ||
|
||
LastFm gem was developed in a hurry and is not a full blown LastFm client neither extensively tested. Feel free to fork it :) | ||
|
||
h1. License (The MIT License) | ||
|
||
## License (The MIT License) | ||
|
||
Copyright (c) 2009 Panagiotis Papadopoulos. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
|
||
|
||
|
||
|
||
[gordon]: http://github.com/gordonbisnor/ | ||
[plugin]: http://github.com/gordonbisnor/lastfm | ||
[api]: http://www.last.fm/api | ||
|