deezer_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/deezer/album.rb +13 -0
- data/app/models/deezer/artist.rb +15 -0
- data/app/models/deezer/track.rb +32 -0
- data/config/initializers/deezer_client.rb +5 -0
- data/lib/deezer_client.rb +4 -0
- data/lib/deezer_client/railties.rb +4 -0
- metadata +100 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
module Deezer
|
2
|
+
class Artist < LogicalModel
|
3
|
+
set_resource_url 'api.deezer.com/2.0', '/artist'
|
4
|
+
force_ssl
|
5
|
+
|
6
|
+
attribute :id
|
7
|
+
attribute :name
|
8
|
+
attribute :link
|
9
|
+
attribute :picture
|
10
|
+
attribute :nb_album
|
11
|
+
attribute :nb_fan
|
12
|
+
attribute :radio
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'protected_attributes'
|
2
|
+
module Deezer
|
3
|
+
# Track on Deezer.
|
4
|
+
# API documentation: http://developers.deezer.com/api/track
|
5
|
+
class Track < LogicalModel
|
6
|
+
|
7
|
+
set_resource_url 'api.deezer.com/2.0', '/track'
|
8
|
+
force_ssl
|
9
|
+
|
10
|
+
attribute :id # The track's Deezer id
|
11
|
+
attribute :readable # true if the track is readable in the player for the current user
|
12
|
+
attribute :title # The track's title
|
13
|
+
attribute :link # The url of the track on Deezer
|
14
|
+
attribute :duration # The track's duration in seconds
|
15
|
+
attribute :track_position # The position of the track in its album
|
16
|
+
attribute :disk_number # The track's album's disk number
|
17
|
+
attribute :rank # The track's Deezer rank
|
18
|
+
attribute :release_date # The track's release date
|
19
|
+
attribute :preview # The url of track's preview file. This file contains the first 30 seconds of the track
|
20
|
+
attribute :artist # artist object containing : id, name, link, picture, nb_album, nb_fan, radio
|
21
|
+
attribute :album # album object containing : id, title, link, cover, release_date
|
22
|
+
|
23
|
+
def album
|
24
|
+
Album.new(@album)
|
25
|
+
end
|
26
|
+
|
27
|
+
def artist
|
28
|
+
Artist.new(@artist)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: deezer_client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dwayne Macgowan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: railties
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.1'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: logical_model
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.5.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.5.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: protected_attributes
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: ! 'This is client library for Deezer API. Music webapp at www.deezer.com. '
|
63
|
+
email:
|
64
|
+
- dwaynemac@gmail.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- app/models/deezer/album.rb
|
70
|
+
- app/models/deezer/track.rb
|
71
|
+
- app/models/deezer/artist.rb
|
72
|
+
- lib/deezer_client.rb
|
73
|
+
- lib/deezer_client/railties.rb
|
74
|
+
- config/initializers/deezer_client.rb
|
75
|
+
homepage: ''
|
76
|
+
licenses: []
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 1.8.25
|
96
|
+
signing_key:
|
97
|
+
specification_version: 3
|
98
|
+
summary: Client library Deezer API
|
99
|
+
test_files: []
|
100
|
+
has_rdoc:
|