GitXplorerGitXplorer
m

omniauth-lastfm

public
13 stars
11 forks
4 issues

Commits

List of commits on branch master.
Unverified
11e090948f7ecb99d0362e72d667b9ea09ad3224

Update omniauth-lastfm.gemspec

mmasterkain committed 8 years ago
Unverified
dec88888b01f5a9036ba1080758cc2832aec9b9d

Bump to 0.0.7

mmasterkain committed 8 years ago
Unverified
64555c4320899e80461ce03d9298d0e1c820ab58

unlock rest client

mmasterkain committed 8 years ago
Unverified
33990bf8078f58e861aff7821330c640c9eb3b0a

Bump to 0.0.6

mmasterkain committed 11 years ago
Unverified
36520e90b437ea4e05042f5e4fe90c7ff5406c1d

update gitignore

mmasterkain committed 11 years ago
Unverified
3d3b5b5919b46e91820ac2c8303ad03e761a1c9e

Merge pull request #5 from krasnoukhov/master

mmasterkain committed 11 years ago

README

The README file for this repository.

OmniAuth Last.fm

Last.fm strategy for OmniAuth 1.0.

Installing

Add to your Gemfile:

gem 'omniauth'
gem 'omniauth-lastfm'

Then bundle install.

Usage

You'll need an API account with Last.fm, you can get one here - http://www.last.fm/api.

Usage of the gem is very similar to other OmniAuth 1.0 strategies. You'll need to add your API keys to config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :lastfm, "consumer_key", "consumer_secret"
end

Now simply follow the README at: https://github.com/intridea/omniauth.

Auth Hash Schema

Here's an example auth hash, available in request.env['omniauth.auth']:

{
   "provider": "lastfm",
   "uid": "ripuk",
   "info": {
      "nickname": "ripuk",
      "name": "David Stephens",
      "url": "http://www.last.fm/user/ripuk",
      "image": "http://userserve-ak.last.fm/serve/252/46787679.jpg",
      "country": "UK",
      "age": "31",
      "gender": "m"
   },
   "credentials": {
      "token": "abcdefghijklmnop",
      "name": "ripuk"
   },
   "extra": {
      "raw_info": {
         "name": "ripuk",
         "realname": "David Stephens",
         "image": [
            {
               "#text": "http://userserve-ak.last.fm/serve/34/46787679.jpg",
               "size": "small"
            },
            {
               "#text": "http://userserve-ak.last.fm/serve/64/46787679.jpg",
               "size": "medium"
            },
            {
               "#text": "http://userserve-ak.last.fm/serve/126/46787679.jpg",
               "size": "large"
            },
            {
               "#text": "http://userserve-ak.last.fm/serve/252/46787679.jpg",
               "size": "extralarge"
            }
         ],
         "url": "http://www.last.fm/user/ripuk",
         "id": "25400308",
         "country": "UK",
         "age": "31",
         "gender": "m",
         "subscriber": "0",
         "playcount": "11530",
         "playlists": "0",
         "bootstrap": "0",
         "registered": {
            "#text": "2009-12-30 00:53",
            "unixtime": "1262134389"
         },
         "type": "user"
      }
   }
}

What Next?

The Rockstar Gem is a great way to make use of the auth token retrieved with this gem.