itunes_api 0.5.1 → 0.6.0
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.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/itunes_api/configuration.rb +8 -0
- data/lib/itunes_api/music/album.rb +13 -0
- data/lib/itunes_api/music/all.rb +4 -0
- data/lib/itunes_api/requests/all.rb +3 -0
- data/lib/itunes_api/requests/base.rb +4 -0
- data/lib/itunes_api/requests/lookup.rb +1 -1
- data/lib/itunes_api/requests/search.rb +1 -1
- data/lib/itunes_api/version.rb +1 -1
- data/lib/itunes_api.rb +7 -8
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d99e396f4049e8c7bd11bc060e06c3ff70aad41
|
4
|
+
data.tar.gz: e4447f6837f2feb4025f414d5de2d23958944830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a713e9774c704803155dcddbc1da773bd5c9c8180144cb5995e9d2d131a4a8916ab97c50b1f9e0fa6946e7d7a1710935ed057edb8c7f8c4ce59a5e06c43f733
|
7
|
+
data.tar.gz: 99dd861be1948e382b33696a7027aceb3e00d8847a3b1016c6906c34368df668b4e4eb97f94c97df675b97ffb9c0a05b8fe7fc64891f025e668c249afa23702b
|
data/README.md
CHANGED
@@ -25,6 +25,16 @@ Or install it yourself as:
|
|
25
25
|
$ gem install itunes_api
|
26
26
|
```
|
27
27
|
|
28
|
+
## Configuration
|
29
|
+
|
30
|
+
Add an initializer to your app to set the country for the Store:
|
31
|
+
```ruby
|
32
|
+
# config/initializers/itunes_api.rb
|
33
|
+
ItunesApi.configure do |config|
|
34
|
+
config.country_code = ENV['COUNTRY_CODE']
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
28
38
|
## Usage
|
29
39
|
|
30
40
|
To return all the AMG ids associated with a search term.
|
@@ -16,6 +16,10 @@ module ItunesApi
|
|
16
16
|
@artwork ||= data[:artworkUrl100]
|
17
17
|
end
|
18
18
|
|
19
|
+
def collection_id
|
20
|
+
@collection_id ||= data[:collectionId]
|
21
|
+
end
|
22
|
+
|
19
23
|
def name
|
20
24
|
@name ||= data[:collectionName]
|
21
25
|
end
|
@@ -24,6 +28,15 @@ module ItunesApi
|
|
24
28
|
@released ||= Date.parse(data[:releaseDate])
|
25
29
|
end
|
26
30
|
|
31
|
+
def to_hash
|
32
|
+
{
|
33
|
+
artwork: artwork,
|
34
|
+
collection_id: collection_id,
|
35
|
+
name: name,
|
36
|
+
released: released,
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
27
40
|
private
|
28
41
|
|
29
42
|
attr_reader :data
|
data/lib/itunes_api/version.rb
CHANGED
data/lib/itunes_api.rb
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
require 'itunes_api/
|
2
|
-
require 'itunes_api/requests/
|
3
|
-
require 'itunes_api/
|
4
|
-
require 'itunes_api/music/album'
|
5
|
-
require 'itunes_api/music/artist'
|
6
|
-
require 'itunes_api/music/artist_lookup'
|
7
|
-
require 'itunes_api/music/artist_search'
|
1
|
+
require 'itunes_api/configuration'
|
2
|
+
require 'itunes_api/requests/all'
|
3
|
+
require 'itunes_api/music/all'
|
8
4
|
|
9
5
|
# Interface to the Itunes Api
|
10
6
|
module ItunesApi
|
11
7
|
BASE_URL = 'https://itunes.apple.com'.freeze
|
12
|
-
COUNTRY_CODE = 'GB'.freeze
|
13
8
|
LIMIT = 200
|
14
9
|
|
15
10
|
def self.artist_ids(name)
|
@@ -23,4 +18,8 @@ module ItunesApi
|
|
23
18
|
def self.artist_search(name)
|
24
19
|
Music::ArtistSearch.artists(name)
|
25
20
|
end
|
21
|
+
|
22
|
+
def self.configure
|
23
|
+
yield(Configuration.instance)
|
24
|
+
end
|
26
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itunes_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario D’Arco
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -112,10 +112,13 @@ files:
|
|
112
112
|
- bin/setup
|
113
113
|
- itunes_api.gemspec
|
114
114
|
- lib/itunes_api.rb
|
115
|
+
- lib/itunes_api/configuration.rb
|
115
116
|
- lib/itunes_api/music/album.rb
|
117
|
+
- lib/itunes_api/music/all.rb
|
116
118
|
- lib/itunes_api/music/artist.rb
|
117
119
|
- lib/itunes_api/music/artist_lookup.rb
|
118
120
|
- lib/itunes_api/music/artist_search.rb
|
121
|
+
- lib/itunes_api/requests/all.rb
|
119
122
|
- lib/itunes_api/requests/base.rb
|
120
123
|
- lib/itunes_api/requests/lookup.rb
|
121
124
|
- lib/itunes_api/requests/search.rb
|