apple_music 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +4 -0
  3. data/.gitignore +4 -0
  4. data/.rubocop.yml +11 -10
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/Gemfile +1 -0
  8. data/Gemfile.lock +50 -35
  9. data/README.md +223 -1
  10. data/apple_music.gemspec +2 -1
  11. data/bin/console +3 -9
  12. data/bin/setup +1 -0
  13. data/lib/apple_music.rb +36 -0
  14. data/lib/apple_music/activity.rb +52 -0
  15. data/lib/apple_music/activity/attributes.rb +19 -0
  16. data/lib/apple_music/activity/relationships.rb +16 -0
  17. data/lib/apple_music/album.rb +62 -0
  18. data/lib/apple_music/album/attributes.rb +50 -0
  19. data/lib/apple_music/album/relationships.rb +18 -0
  20. data/lib/apple_music/apple_curator.rb +10 -0
  21. data/lib/apple_music/apple_curator/attributes.rb +19 -0
  22. data/lib/apple_music/apple_curator/relationships.rb +16 -0
  23. data/lib/apple_music/artist.rb +67 -0
  24. data/lib/apple_music/artist/attributes.rb +19 -0
  25. data/lib/apple_music/artist/relationships.rb +20 -0
  26. data/lib/apple_music/artwork.rb +30 -0
  27. data/lib/apple_music/chart.rb +33 -0
  28. data/lib/apple_music/chart_response.rb +21 -0
  29. data/lib/apple_music/config.rb +45 -0
  30. data/lib/apple_music/connection.rb +45 -0
  31. data/lib/apple_music/curator.rb +52 -0
  32. data/lib/apple_music/curator/attributes.rb +19 -0
  33. data/lib/apple_music/curator/relationships.rb +16 -0
  34. data/lib/apple_music/editorial_notes.rb +13 -0
  35. data/lib/apple_music/error.rb +27 -0
  36. data/lib/apple_music/genre.rb +38 -0
  37. data/lib/apple_music/genre/attributes.rb +16 -0
  38. data/lib/apple_music/music_video.rb +76 -0
  39. data/lib/apple_music/music_video/attributes.rb +42 -0
  40. data/lib/apple_music/music_video/relationships.rb +18 -0
  41. data/lib/apple_music/play_parameters.rb +13 -0
  42. data/lib/apple_music/playlist.rb +57 -0
  43. data/lib/apple_music/playlist/attributes.rb +45 -0
  44. data/lib/apple_music/playlist/relationships.rb +17 -0
  45. data/lib/apple_music/preview.rb +13 -0
  46. data/lib/apple_music/relationship.rb +23 -0
  47. data/lib/apple_music/resource.rb +57 -0
  48. data/lib/apple_music/response.rb +29 -0
  49. data/lib/apple_music/search.rb +39 -0
  50. data/lib/apple_music/search_result.rb +20 -0
  51. data/lib/apple_music/song.rb +81 -0
  52. data/lib/apple_music/song/attributes.rb +39 -0
  53. data/lib/apple_music/song/relationships.rb +19 -0
  54. data/lib/apple_music/station.rb +38 -0
  55. data/lib/apple_music/station/attributes.rb +27 -0
  56. data/lib/apple_music/storefront.rb +32 -0
  57. data/lib/apple_music/storefront/attributes.rb +18 -0
  58. data/lib/apple_music/version.rb +1 -1
  59. metadata +66 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1887fda5822460ebdb3892c06c038a1813759785f1369a595449b1dbed4020b
4
- data.tar.gz: 3971b55a46ec174e8bca6e53f0237b5ab7c3cc54488f883ab5d36cfa60e1634b
3
+ metadata.gz: d773101a4961951410d2edccd94c7dd2e76a98fa978eb45983271da26558c4bd
4
+ data.tar.gz: a46aa197c924a7408e57bad1b95a050aee764a8e85b00430c58d2e554d09ff62
5
5
  SHA512:
6
- metadata.gz: b2a7e4e0830d826619decc21ea40e03d800073212b8a72ed02b187b76f00f1b5293ca9ee68734b2faa9d307cb7d3a15f31dd1b8c069cdadd4645ea109cc50b6f
7
- data.tar.gz: 0dda0f8713ba1f0eaf7f3f22a8b2ab9f28217ee76e8cb74a776934cbe08892c9dcb93f91976fe2a2f5cda53938c7076affbba26d3f979bece74cfd9a0289aa7f
6
+ metadata.gz: c29ae368a3bf849a606679e09e43b8a91724abdd0955ac12e64566ada0daaa78e3af98999d2e35c14246f69947e7c2e666819236be19b5d83c6e4185ac2ed5e1
7
+ data.tar.gz: 2d9f3ee87e0e8f22033d464110e165ced128c704c92cfe0da9e81c5f2303e3d59e86d5e9286baa1649309d12fbb58f5b7210feb3fefeb8aab9f293335cf0e4dd
data/.env.example ADDED
@@ -0,0 +1,4 @@
1
+ export APPLE_MUSIC_SECRET_KEY_PATH=YOUR_SECRET_KEY_PATH
2
+ export APPLE_MUSIC_TEAM_ID=YOUR_TEAM_ID
3
+ export APPLE_MUSIC_MUSIC_ID=YOUR_MUSIC_ID
4
+ export APPLE_MUSIC_STOREFRONT=us
data/.gitignore CHANGED
@@ -9,3 +9,7 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ # apple music secret file
14
+ *.p8
15
+ .env
data/.rubocop.yml CHANGED
@@ -1,10 +1,11 @@
1
- # The behavior of RuboCop can be controlled via the .rubocop.yml
2
- # configuration file. It makes it possible to enable/disable
3
- # certain cops (checks) and to alter their behavior if they accept
4
- # any parameters. The file can be placed either in your home
5
- # directory or in some project directory.
6
- #
7
- # RuboCop will start looking for the configuration file in the directory
8
- # where the inspected file is and continue its way up to the root directory.
9
- #
10
- # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
1
+ Naming/PredicateName:
2
+ Enabled: false
3
+
4
+ Style/Documentation:
5
+ Enabled: false
6
+
7
+ Style/ClassAndModuleChildren:
8
+ Enabled: false
9
+
10
+ Metrics:
11
+ Enabled: false
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ apple_music
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile CHANGED
@@ -5,5 +5,6 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in apple_music.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'dotenv'
8
9
  gem 'pry'
9
10
  gem 'rubocop'
data/Gemfile.lock CHANGED
@@ -1,63 +1,78 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apple_music (0.1.0)
5
- faraday (>= 0.15.4)
4
+ apple_music (0.2.0)
5
+ faraday
6
+ faraday_middleware
6
7
  jwt (>= 2.2)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- ast (2.4.0)
12
- coderay (1.1.2)
13
- diff-lcs (1.3)
14
- faraday (0.15.4)
12
+ ast (2.4.2)
13
+ coderay (1.1.3)
14
+ diff-lcs (1.4.4)
15
+ dotenv (2.7.6)
16
+ faraday (1.3.0)
17
+ faraday-net_http (~> 1.0)
15
18
  multipart-post (>= 1.2, < 3)
16
- jaro_winkler (1.5.3)
17
- jwt (2.2.1)
18
- method_source (0.9.2)
19
+ ruby2_keywords
20
+ faraday-net_http (1.0.1)
21
+ faraday_middleware (1.0.0)
22
+ faraday (~> 1.0)
23
+ jwt (2.2.2)
24
+ method_source (1.0.0)
19
25
  multipart-post (2.1.1)
20
- parallel (1.17.0)
21
- parser (2.6.3.0)
22
- ast (~> 2.4.0)
23
- pry (0.12.2)
24
- coderay (~> 1.1.0)
25
- method_source (~> 0.9.0)
26
+ parallel (1.20.1)
27
+ parser (3.0.0.0)
28
+ ast (~> 2.4.1)
29
+ pry (0.13.1)
30
+ coderay (~> 1.1)
31
+ method_source (~> 1.0)
26
32
  rainbow (3.0.0)
27
- rake (12.3.2)
28
- rspec (3.8.0)
29
- rspec-core (~> 3.8.0)
30
- rspec-expectations (~> 3.8.0)
31
- rspec-mocks (~> 3.8.0)
32
- rspec-core (3.8.1)
33
- rspec-support (~> 3.8.0)
34
- rspec-expectations (3.8.4)
33
+ rake (13.0.3)
34
+ regexp_parser (2.0.3)
35
+ rexml (3.2.4)
36
+ rspec (3.10.0)
37
+ rspec-core (~> 3.10.0)
38
+ rspec-expectations (~> 3.10.0)
39
+ rspec-mocks (~> 3.10.0)
40
+ rspec-core (3.10.1)
41
+ rspec-support (~> 3.10.0)
42
+ rspec-expectations (3.10.1)
35
43
  diff-lcs (>= 1.2.0, < 2.0)
36
- rspec-support (~> 3.8.0)
37
- rspec-mocks (3.8.1)
44
+ rspec-support (~> 3.10.0)
45
+ rspec-mocks (3.10.2)
38
46
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.8.0)
40
- rspec-support (3.8.2)
41
- rubocop (0.71.0)
42
- jaro_winkler (~> 1.5.1)
47
+ rspec-support (~> 3.10.0)
48
+ rspec-support (3.10.2)
49
+ rubocop (1.9.1)
43
50
  parallel (~> 1.10)
44
- parser (>= 2.6)
51
+ parser (>= 3.0.0.0)
45
52
  rainbow (>= 2.2.2, < 4.0)
53
+ regexp_parser (>= 1.8, < 3.0)
54
+ rexml
55
+ rubocop-ast (>= 1.2.0, < 2.0)
46
56
  ruby-progressbar (~> 1.7)
47
- unicode-display_width (>= 1.4.0, < 1.7)
48
- ruby-progressbar (1.10.1)
49
- unicode-display_width (1.6.0)
57
+ unicode-display_width (>= 1.4.0, < 3.0)
58
+ rubocop-ast (1.4.1)
59
+ parser (>= 2.7.1.5)
60
+ ruby-progressbar (1.11.0)
61
+ ruby2_keywords (0.0.4)
62
+ unicode-display_width (2.0.0)
50
63
 
51
64
  PLATFORMS
52
- ruby
65
+ x86_64-darwin-18
66
+ x86_64-linux
53
67
 
54
68
  DEPENDENCIES
55
69
  apple_music!
56
70
  bundler
71
+ dotenv
57
72
  pry
58
73
  rake
59
74
  rspec
60
75
  rubocop
61
76
 
62
77
  BUNDLED WITH
63
- 2.0.1
78
+ 2.2.14
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AppleMusic
2
2
 
3
- Apple Music API Client in Ruby
3
+ This is a ruby wrapper for the [Apple Music API](https://developer.apple.com/documentation/applemusicapi).
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,6 +18,228 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install apple_music
20
20
 
21
+ ## Usage
22
+
23
+ AppleMusic gem was designed with usability as its primary goal:
24
+
25
+ #### e.g. Search Artists
26
+
27
+ ```ruby
28
+ artist = AppleMusic::Artist.search('Men I Trust').first # AppleMusic::Artist object
29
+ artist.genre_names # ['Electronic']
30
+ artist.id # "886240553"
31
+ albums = AppleMusic::Artist.related_albums(886240553).map(&:name) # ["Oncle Jazz", "Headroom"...
32
+ ```
33
+
34
+ #### e.g. Search Albums
35
+
36
+ ```ruby
37
+ albums = AppleMusic::Album.search('BILL EVANS') # AppleMusic::Album object
38
+ tracks = AppleMusic::Album.related_tracks(albums[0].id)
39
+ tracks.first.name # "Waltz for Debby"
40
+ ```
41
+
42
+ #### e.g. Search Songs
43
+
44
+ ```ruby
45
+ songs = AppleMusic::Song.search('Document', storefront: :jp) # AppleMusic::Song object
46
+ songs[0].artist_name # "TENDRE"
47
+ songs[0].album_name # "NOT IN ALMIGHTY"
48
+ ```
49
+
50
+ ## Features
51
+
52
+ Currently, it work in progress, so it can use apis which does not need user token.
53
+
54
+ ### Albums
55
+
56
+ | Feature | Status | Docs | Code |
57
+ |:--------|:------:|:----:|:----:|
58
+ | Get a Catalog Album | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_album) | [:octocat:](#) |
59
+ | Get a Catalog Album's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_album_s_relationship_directly_by_name) | [:octocat:](#) |
60
+ | Get Multiple Catalog Albums | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_albums) | [:octocat:](#) |
61
+ | Get a Library Album | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_album) | |
62
+ | Get a Library Album's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_album_s_relationship_directly_by_name) | |
63
+ | Get Multiple Library Albums | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_library_albums) | |
64
+ | Get All Library Albums | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_library_albums) | |
65
+
66
+ ### Artists
67
+
68
+ | Feature | Status | Docs | Code |
69
+ |:--------|:------:|:----:|:----:|
70
+ | Get a Catalog Artist | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_artist) | [:octocat:](#) |
71
+ | Get Multiple Catalog Artists | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_artists) | [:octocat:](#) |
72
+ | Get a Catalog Artist's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_artist_s_relationship_directly_by_name) | [:octocat:](#) |
73
+ | Get a Library Artist | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_artist) | |
74
+ | Get All Library Artists | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_library_artists) | |
75
+ | Get Multiple Library Artists | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_library_artists) | |
76
+ | Get a Library Artist's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_artist_s_relationship_directly_by_name) | |
77
+
78
+ ### Songs
79
+
80
+ | Feature | Status | Docs | Code |
81
+ |:--------|:------:|:----:|:----:|
82
+ | Get a Catalog Song | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_song) | [:octocat:](#) |
83
+ | Get Multiple Catalog Songs by ID | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_songs_by_id) | [:octocat:](#) |
84
+ | Get Multiple Catalog Songs by ISRC | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_songs_by_isrc) | [:octocat:](#) |
85
+ | Get a Catalog Song's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_song_s_relationship_directly_by_name) | [:octocat:](#) |
86
+ | Get a Library Song | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_song) | |
87
+ | Get All Library Songs | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_library_songs) | |
88
+ | Get Multiple Library Songs | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_library_songs) | |
89
+ | Get a Library Song's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_song_s_relationship_directly_by_name) | |
90
+
91
+ ### Music Videos
92
+
93
+ | Feature | Status | Docs | Code |
94
+ |:--------|:------:|:----:|:----:|
95
+ | Get a Catalog Music Video | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_music_video) | [:octocat:](#) |
96
+ | Get a Catalog Music Video's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_music_video_s_relationship_directly_by_name) | [:octocat:](#) |
97
+ | Get Multiple Catalog Music Videos by ID | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_music_videos_by_id) | [:octocat:](#) |
98
+ | Get Multiple Catalog Music Videos by ISRC | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_music_videos_by_isrc) | [:octocat:](#) |
99
+ | Get a Library Music Video | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_music_video) | |
100
+ | Get a Library Music Video's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_music_video_s_relationship_directly_by_name) | |
101
+ | Get Multiple Library Music Videos | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_library_music_videos) | |
102
+ | Get All Library Music Videos | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_library_music_videos) | |
103
+
104
+ ### Playlists
105
+
106
+ | Feature | Status | Docs | Code |
107
+ |:--------|:------:|:----:|:----:|
108
+ | Get a Catalog Playlist | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_playlist) | [:octocat:](#) |
109
+ | Get a Catalog Playlist's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_playlist_s_relationship_directly_by_name) | [:octocat:](#) |
110
+ | Get Multiple Catalog Playlists | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_playlists) | [:octocat:](#) |
111
+ | Get a Library Playlist | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_playlist) | |
112
+ | Get a Library Playlist's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_library_playlist_s_relationship_directly_by_name) | |
113
+ | Get Multiple Library Playlists | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_library_playlists) | |
114
+ | Get All Library Playlists | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_library_playlists) | |
115
+
116
+ ### Apple Music Stations
117
+
118
+ | Feature | Status | Docs | Code |
119
+ |:--------|:------:|:----:|:----:|
120
+ | Get a Catalog Station | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_station) | [:octocat:](#) |
121
+ | Get Multiple Catalog Stations | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_stations) | [:octocat:](#) |
122
+
123
+ ### Search
124
+
125
+ | Feature | Status | Docs | Code |
126
+ |:--------|:------:|:----:|:----:|
127
+ | Search for Catalog Resources | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/search_for_catalog_resources) | [:octocat:](#) |
128
+ | Get Catalog Search Hints | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_catalog_search_hints) | [:octocat:](#) |
129
+ | Search for Library Resources | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/search_for_library_resources) | |
130
+
131
+ ### Ratings
132
+
133
+ | Feature | Status | Docs | Code |
134
+ |:--------|:------:|:----:|:----:|
135
+ | Get a Personal Album Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_album_rating) | |
136
+ | Get a Personal Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_music_video_rating) | |
137
+ | Get a Personal Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_playlist_rating) | |
138
+ | Get a Personal Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_song_rating) | |
139
+ | Get a Personal Station Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_station_rating) | |
140
+ | Get Multiple Personal Album Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_album_ratings) | |
141
+ | Get Multiple Personal Music Video Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_music_video_ratings) | |
142
+ | Get Multiple Personal Playlist Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_playlist_ratings) | |
143
+ | Get Multiple Personal Song Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_song_ratings) | |
144
+ | Get Multiple Personal Station Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_station_ratings) | |
145
+ | Add a Personal Album Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_album_rating) | |
146
+ | Add a Personal Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_music_video_rating) | |
147
+ | Add a Personal Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_playlist_rating) | |
148
+ | Add a Personal Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_song_rating) | |
149
+ | Add a Personal Station Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_station_rating) | |
150
+ | Delete a Personal Album Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_album_rating) | |
151
+ | Delete a Personal Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_music_video_rating) | |
152
+ | Delete a Personal Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_playlist_rating) | |
153
+ | Delete a Personal Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_song_rating) | |
154
+ | Delete a Personal Station Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_station_rating) | |
155
+ | Get a Personal Library Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_library_music_video_rating) | |
156
+ | Get a Personal Library Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_library_playlist_rating) | |
157
+ | Get a Personal Library Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_personal_library_song_rating) | |
158
+ | Get Multiple Personal Library Music Video Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_library_music_video_ratings) | |
159
+ | Get Multiple Personal Library Playlist Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_library_playlist_ratings) | |
160
+ | Get Multiple Personal Library Songs Ratings | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_personal_library_songs_ratings) | |
161
+ | Add a Personal Library Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_library_music_video_rating) | |
162
+ | Add a Personal Library Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_library_playlist_rating) | |
163
+ | Add a Personal Library Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/add_a_personal_library_song_rating) | |
164
+ | Delete a Personal Library Music Video Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_library_music_video_rating) | |
165
+ | Delete a Personal Library Playlist Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_library_playlist_rating) | |
166
+ | Delete a Personal Library Song Rating | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/delete_a_personal_library_song_rating) | |
167
+
168
+ ### Charts
169
+
170
+ | Feature | Status | Docs | Code |
171
+ |:--------|:------:|:----:|:----:|
172
+ | Get Catalog Charts | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_catalog_charts) | [:octocat:](#) |
173
+
174
+ ### Music Genres
175
+
176
+ | Feature | Status | Docs | Code |
177
+ |:--------|:------:|:----:|:----:|
178
+ | Get a Catalog Genre | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_genre) | [:octocat:](#) |
179
+ | Get a Catalog Genre's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_genre_s_relationship_directly_by_name) | [:octocat:](#) |
180
+ | Get Multiple Catalog Genres | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_genres) | [:octocat:](#) |
181
+ | Get Catalog Top Charts Genres | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_catalog_top_charts_genres) | [:octocat:](#) |
182
+
183
+ ### Curators
184
+
185
+ | Feature | Status | Docs | Code |
186
+ |:--------|:------:|:----:|:----:|
187
+ | Get a Catalog Curator | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_curator) | [:octocat:](#) |
188
+ | Get a Catalog Curator's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_curator_s_relationship_directly_by_name) | [:octocat:](#) |
189
+ | Get Multiple Catalog Curators | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_curators) | [:octocat:](#) |
190
+ | Get a Catalog Apple Curator | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_apple_curator) | |
191
+ | Get a Catalog Apple Curator's Relationship Directly by Name | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_apple_curator_s_relationship_directly_by_name) | |
192
+ | Get Multiple Catalog Apple Curators | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_apple_curators) | |
193
+
194
+ ### Recommendations
195
+
196
+ | Feature | Status | Docs | Code |
197
+ |:--------|:------:|:----:|:----:|
198
+ | Get a Recommendation | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_recommendation) | |
199
+ | Get Multiple Recommendations | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_recommendations) | |
200
+ | Get Default Recommendations | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_default_recommendations) | |
201
+
202
+ ### Activities
203
+
204
+ | Feature | Status | Docs | Code |
205
+ |:--------|:------:|:----:|:----:|
206
+ | Get a Catalog Activity | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_activity) | [:octocat:](#) |
207
+ | Get a Catalog Activity's Relationship Directly by Name | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_catalog_activity_s_relationship_directly_by_name) | [:octocat:](#) |
208
+ | Get Multiple Catalog Activities | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_catalog_activities) | [:octocat:](#) |
209
+
210
+ ### History
211
+
212
+ | Feature | Status | Docs | Code |
213
+ |:--------|:------:|:----:|:----:|
214
+ | Get Heavy Rotation Content | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_heavy_rotation_content) | |
215
+ | Get Recently Played Resources | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_recently_played_resources) | |
216
+ | Get Recently Played Stations | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_recently_played_stations) | |
217
+ | Get Recently Added Resources | :no_entry: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_recently_added_resources) | |
218
+
219
+ ### Storefronts and Localization
220
+
221
+ | Feature | Status | Docs | Code |
222
+ |:--------|:------:|:----:|:----:|
223
+ | Get a User's Storefront | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_user_s_storefront) | [:octocat:](#) |
224
+ | Get a Storefront | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_a_storefront) | [:octocat:](#) |
225
+ | Get Multiple Storefronts | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_multiple_storefronts) | [:octocat:](#) |
226
+ | Get All Storefronts | :white_check_mark: | [:link:](https://developer.apple.com/documentation/applemusicapi/get_all_storefronts) | [:octocat:](#) |
227
+
228
+ ## Configuration
229
+
230
+ **NOTE** It's necessary to prepare an `TEAM_ID`, `MUSIC_ID`, and a secret file in advance. Please confirm [Apple Developer Website](https://developer.apple.com/).
231
+
232
+ It can be set by either an `ENV` variable or an `config/initializers/apple_music.rb`:
233
+
234
+ ```ruby
235
+ AppleMusic.configure do |config|
236
+ config.secret_key_path = './AuthKey_MUSIC_ID.p8' # or ENV['APPLE_MUSIC_SECRET_KEY_PATH']
237
+ config.team_id = 'YOUR TEAM_ID' # or ENV['APPLE_MUSIC_TEAM_ID']
238
+ config.music_id = 'YOUR MUSIC_ID' # or ENV['APPLE_MUSIC_MUSIC_ID']
239
+ config.storefront = 'jp' # or ENV['APPLE_MUSIC_STOREFRONT'] ('us' by default)
240
+ end
241
+ ```
242
+
21
243
  ## License
22
244
 
23
245
  MIT
data/apple_music.gemspec CHANGED
@@ -24,7 +24,8 @@ Gem::Specification.new do |s|
24
24
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  s.require_paths = ['lib']
26
26
 
27
- s.add_dependency 'faraday', '>= 0.15.4'
27
+ s.add_dependency 'faraday'
28
+ s.add_dependency 'faraday_middleware'
28
29
  s.add_dependency 'jwt', '>= 2.2'
29
30
 
30
31
  s.add_development_dependency 'bundler'
data/bin/console CHANGED
@@ -2,14 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
+ require 'dotenv/load'
5
6
  require 'apple_music'
6
7
 
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
8
+ require 'pry'
9
+ Pry.start
data/bin/setup CHANGED
@@ -6,3 +6,4 @@ set -vx
6
6
  bundle install
7
7
 
8
8
  # Do any other automated setup that you need to do here
9
+ cp .env.exmple .env