spotify_web 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ ## Generated from radio.proto for spotify.radio.proto
2
+ require "beefcake"
3
+
4
+ module SpotifyWeb
5
+ module Schema
6
+ module Radio
7
+
8
+ class RadioRequest
9
+ include Beefcake::Message
10
+ end
11
+
12
+ class MultiSeedRequest
13
+ include Beefcake::Message
14
+ end
15
+
16
+ class Feedback
17
+ include Beefcake::Message
18
+ end
19
+
20
+ class Tracks
21
+ include Beefcake::Message
22
+ end
23
+
24
+ class Station
25
+ include Beefcake::Message
26
+ end
27
+
28
+ class Rules
29
+ include Beefcake::Message
30
+ end
31
+
32
+ class StationResponse
33
+ include Beefcake::Message
34
+ end
35
+
36
+ class StationList
37
+ include Beefcake::Message
38
+ end
39
+
40
+ class LikedPlaylist
41
+ include Beefcake::Message
42
+ end
43
+
44
+ class RadioRequest
45
+ repeated :uris, :string, 1
46
+ optional :salt, :int32, 2
47
+ optional :length, :int32, 4
48
+ optional :stationId, :string, 5
49
+ repeated :lastTracks, :string, 6
50
+ end
51
+
52
+
53
+ class MultiSeedRequest
54
+ repeated :uris, :string, 1
55
+ end
56
+
57
+
58
+ class Feedback
59
+ optional :uri, :string, 1
60
+ optional :type, :string, 2
61
+ optional :timestamp, :double, 3
62
+ end
63
+
64
+
65
+ class Tracks
66
+ repeated :gids, :string, 1
67
+ optional :source, :string, 2
68
+ optional :identity, :string, 3
69
+ repeated :tokens, :string, 4
70
+ repeated :feedback, Feedback, 5
71
+ end
72
+
73
+
74
+ class Station
75
+ optional :id, :string, 1
76
+ optional :title, :string, 2
77
+ optional :titleUri, :string, 3
78
+ optional :subtitle, :string, 4
79
+ optional :subtitleUri, :string, 5
80
+ optional :imageUri, :string, 6
81
+ optional :lastListen, :double, 7
82
+ repeated :seeds, :string, 8
83
+ optional :thumbsUp, :int32, 9
84
+ optional :thumbsDown, :int32, 10
85
+ end
86
+
87
+
88
+ class Rules
89
+ optional :js, :string, 1
90
+ end
91
+
92
+
93
+ class StationResponse
94
+ optional :station, Station, 1
95
+ repeated :feedback, Feedback, 2
96
+ end
97
+
98
+
99
+ class StationList
100
+ repeated :stations, Station, 1
101
+ end
102
+
103
+
104
+ class LikedPlaylist
105
+ optional :uri, :string, 1
106
+ end
107
+
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,106 @@
1
+ ## Generated from socialgraph.proto for spotify.socialgraph.proto
2
+ require "beefcake"
3
+
4
+ module SpotifyWeb
5
+ module Schema
6
+ module Socialgraph
7
+
8
+ class CountReply
9
+ include Beefcake::Message
10
+ end
11
+
12
+ class UserListRequest
13
+ include Beefcake::Message
14
+ end
15
+
16
+ class UserListReply
17
+ include Beefcake::Message
18
+ end
19
+
20
+ class User
21
+ include Beefcake::Message
22
+ end
23
+
24
+ class ArtistListReply
25
+ include Beefcake::Message
26
+ end
27
+
28
+ class Artist
29
+ include Beefcake::Message
30
+ end
31
+
32
+ class StringListRequest
33
+ include Beefcake::Message
34
+ end
35
+
36
+ class StringListReply
37
+ include Beefcake::Message
38
+ end
39
+
40
+ class TopPlaylistsRequest
41
+ include Beefcake::Message
42
+ end
43
+
44
+ class TopPlaylistsReply
45
+ include Beefcake::Message
46
+ end
47
+
48
+ class CountReply
49
+ repeated :counts, :int32, 1
50
+ end
51
+
52
+
53
+ class UserListRequest
54
+ optional :last_result, :string, 1
55
+ optional :count, :int32, 2
56
+ optional :include_length, :bool, 3
57
+ end
58
+
59
+
60
+ class UserListReply
61
+ repeated :users, User, 1
62
+ optional :length, :int32, 2
63
+ end
64
+
65
+
66
+ class User
67
+ optional :username, :string, 1
68
+ optional :subscriber_count, :int32, 2
69
+ optional :subscription_count, :int32, 3
70
+ end
71
+
72
+
73
+ class ArtistListReply
74
+ repeated :artists, Artist, 1
75
+ end
76
+
77
+
78
+ class Artist
79
+ optional :artistid, :string, 1
80
+ optional :subscriber_count, :int32, 2
81
+ end
82
+
83
+
84
+ class StringListRequest
85
+ repeated :args, :string, 1
86
+ end
87
+
88
+
89
+ class StringListReply
90
+ repeated :reply, :string, 1
91
+ end
92
+
93
+
94
+ class TopPlaylistsRequest
95
+ optional :username, :string, 1
96
+ optional :count, :int32, 2
97
+ end
98
+
99
+
100
+ class TopPlaylistsReply
101
+ repeated :uris, :string, 1
102
+ end
103
+
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,58 @@
1
+ require 'spotify_web/resource'
2
+ require 'spotify_web/album'
3
+ require 'spotify_web/artist'
4
+ require 'spotify_web/schema/metadata.pb'
5
+
6
+ module SpotifyWeb
7
+ # Represents a song on Spotify
8
+ class Song < Resource
9
+ self.metadata_schema = Schema::Metadata::Track
10
+ self.resource_name = 'track'
11
+
12
+ # The title of the song
13
+ # @return [String]
14
+ attribute :title, :name
15
+
16
+ # Info about the artist
17
+ # @return [SpotifyWeb::Artist]
18
+ attribute :artist do |artist|
19
+ Artist.new(client, artist[0].to_hash)
20
+ end
21
+
22
+ # Info about the album
23
+ # @return [SpotifyWeb::Album]
24
+ attribute :album do |album|
25
+ Album.new(client, album.to_hash)
26
+ end
27
+
28
+ # The disc the song is located on within the album
29
+ # @return [Fixnum]
30
+ attribute :disc_number
31
+
32
+ # The track number on the disc
33
+ # @return [Fixnum]
34
+ attribute :number
35
+
36
+ # Number of seconds the song lasts
37
+ # @return [Fixnum]
38
+ attribute :length, :duration do |length|
39
+ length / 1000
40
+ end
41
+
42
+ # The relative popularity of this song on Spotify
43
+ # @return [Fixnum]
44
+ attribute :popularity
45
+
46
+ # The countries for which this song is permitted to be played
47
+ # @return [Array<SpotifyWeb::Restriction>]
48
+ attribute :restrictions, :restriction do |restrictions|
49
+ restrictions.map {|restriction| Restriction.new(client, restriction.to_hash)}
50
+ end
51
+
52
+ # Whether this song is available to the user
53
+ # @return [Boolean]
54
+ def available?
55
+ restrictions.all? {|restriction| restriction.permitted?}
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,7 @@
1
+ require 'spotify_web/resource'
2
+
3
+ module SpotifyWeb
4
+ # Represents an unauthorized user on Spotify
5
+ class User < Resource
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ module SpotifyWeb
2
+ # The current version of the library
3
+ module Version
4
+ MAJOR = 0
5
+ MINOR = 0
6
+ PATCH = 1
7
+ STRING = [MAJOR, MINOR, PATCH].join(".")
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ require File.join("#{File.dirname(__FILE__)}/spotify_web)
@@ -0,0 +1,9 @@
1
+ namespace :spotify
2
+ desc 'Builds the schemas based on the current Spotify definitions'
3
+ task :build_schemas do
4
+ $:.unshift(File.dirname(__FILE__) + '/..')
5
+ require 'spotify_web'
6
+
7
+ SpotifyWeb::Schema.build_all
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ $LOAD_PATH << File.expand_path("../../lib", __FILE__)
2
+
3
+ require 'spotify_web'
4
+
5
+ RSpec.configure do |config|
6
+ config.order = 'random'
7
+ end
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ describe SpotifyWeb do
4
+ end
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ require 'spotify_web/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "spotify_web"
6
+ s.version = SpotifyWeb::Version::STRING
7
+ s.authors = ["Aaron Pfeifer"]
8
+ s.email = "aaron.pfeifer@gmail.com"
9
+ s.homepage = "http://github.com/obrie/spotify_web"
10
+ s.description = "Spotify Web API for Ruby"
11
+ s.summary = "Spotify Web API for Ruby"
12
+ s.require_paths = ["lib"]
13
+ s.files = `git ls-files`.split("\n")
14
+ s.test_files = `git ls-files -- test/*`.split("\n")
15
+ s.rdoc_options = %w(--line-numbers --inline-source --title spotify_web --main README.md)
16
+ s.extra_rdoc_files = %w(README.md CHANGELOG.md LICENSE)
17
+
18
+ s.add_runtime_dependency("beefcake")
19
+ s.add_runtime_dependency("em-synchrony")
20
+ s.add_runtime_dependency("em-http-request")
21
+ s.add_runtime_dependency("execjs")
22
+ s.add_runtime_dependency("faye-websocket")
23
+ s.add_runtime_dependency("radix")
24
+ s.add_development_dependency("rake")
25
+ s.add_development_dependency("rspec", "~> 2.11")
26
+ s.add_development_dependency("simplecov")
27
+ end
metadata ADDED
@@ -0,0 +1,216 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spotify_web
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Aaron Pfeifer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: beefcake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: em-synchrony
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: em-http-request
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: execjs
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: faye-websocket
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: radix
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '2.11'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '2.11'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: Spotify Web API for Ruby
140
+ email: aaron.pfeifer@gmail.com
141
+ executables: []
142
+ extensions: []
143
+ extra_rdoc_files:
144
+ - README.md
145
+ - CHANGELOG.md
146
+ - LICENSE
147
+ files:
148
+ - .gitignore
149
+ - .rspec
150
+ - .yardopts
151
+ - CHANGELOG.md
152
+ - Gemfile
153
+ - LICENSE
154
+ - README.md
155
+ - Rakefile
156
+ - examples/playlists.rb
157
+ - lib/spotify_web.rb
158
+ - lib/spotify_web/album.rb
159
+ - lib/spotify_web/artist.rb
160
+ - lib/spotify_web/assertions.rb
161
+ - lib/spotify_web/authorized_user.rb
162
+ - lib/spotify_web/client.rb
163
+ - lib/spotify_web/connection.rb
164
+ - lib/spotify_web/error.rb
165
+ - lib/spotify_web/event.rb
166
+ - lib/spotify_web/handler.rb
167
+ - lib/spotify_web/loggable.rb
168
+ - lib/spotify_web/playlist.rb
169
+ - lib/spotify_web/resource.rb
170
+ - lib/spotify_web/resource_collection.rb
171
+ - lib/spotify_web/restriction.rb
172
+ - lib/spotify_web/schema.rb
173
+ - lib/spotify_web/schema/core.pb.rb
174
+ - lib/spotify_web/schema/mercury.pb.rb
175
+ - lib/spotify_web/schema/metadata.pb.rb
176
+ - lib/spotify_web/schema/playlist4.pb.rb
177
+ - lib/spotify_web/schema/radio.pb.rb
178
+ - lib/spotify_web/schema/socialgraph.pb.rb
179
+ - lib/spotify_web/song.rb
180
+ - lib/spotify_web/user.rb
181
+ - lib/spotify_web/version.rb
182
+ - lib/tasks/spotify_web.rake
183
+ - lib/tasks/spotify_web.rb
184
+ - spec/spec_helper.rb
185
+ - spec/spotify_web_spec.rb
186
+ - spotify_web.gemspec
187
+ homepage: http://github.com/obrie/spotify_web
188
+ licenses: []
189
+ metadata: {}
190
+ post_install_message:
191
+ rdoc_options:
192
+ - --line-numbers
193
+ - --inline-source
194
+ - --title
195
+ - spotify_web
196
+ - --main
197
+ - README.md
198
+ require_paths:
199
+ - lib
200
+ required_ruby_version: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - '>='
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
205
+ required_rubygems_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - '>='
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ requirements: []
211
+ rubyforge_project:
212
+ rubygems_version: 2.0.3
213
+ signing_key:
214
+ specification_version: 4
215
+ summary: Spotify Web API for Ruby
216
+ test_files: []