songstats-ruby-sdk 0.1.0 → 0.2.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/CHANGELOG.md +12 -0
- data/README.md +86 -27
- data/docs/enterprise_routes_audit.md +83 -94
- data/lib/songstats_sdk/client.rb +1 -3
- data/lib/songstats_sdk/resources.rb +0 -2
- data/lib/songstats_sdk/version.rb +1 -1
- metadata +2 -4
- data/lib/songstats_sdk/resources/charts.rb +0 -14
- data/lib/songstats_sdk/resources/stations.rb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 68f9bea062fc60a216913e84f5baee27b28f18711eb83c6b9e705a81ffe68a9b
|
|
4
|
+
data.tar.gz: 5b3dcd8661f8555c6315d0e304aad2069faf645d88d06389ae4ee3be52598211
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f419d4f531a1ebc3d11149e946636c0561f039fac22e96b972f0f296fd34a6f43aa1cb7fa64e8aca374d9cda935b57484a2123f34232374b58e77465d3989148
|
|
7
|
+
data.tar.gz: 232391634c9586fdb9ea2d09501f27e9e44c6f4c9842b4d42ca5164ec7cc4a011e5325b44e8b6370cd133c575f137ad10c1b0fbe038191275df0e117ac18cd70
|
data/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.0] - 2026-02-19
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Removed `charts` resource client from the SDK surface
|
|
10
|
+
- Removed `stations` resource client from the SDK surface
|
|
11
|
+
- Kept `info` endpoints:
|
|
12
|
+
- `client.info.sources` (`/sources`)
|
|
13
|
+
- `client.info.status` (`/status`)
|
|
14
|
+
- `client.info.definitions` (`/definitions`)
|
|
15
|
+
|
|
5
16
|
## [0.1.0] - 2026-02-19
|
|
6
17
|
|
|
7
18
|
### Added
|
|
19
|
+
|
|
8
20
|
- Initial standalone Ruby SDK repo for Songstats Enterprise API (`/enterprise/v1`)
|
|
9
21
|
- Full resource coverage:
|
|
10
22
|
- `info`
|
data/README.md
CHANGED
|
@@ -1,55 +1,114 @@
|
|
|
1
1
|
# Songstats Ruby SDK
|
|
2
2
|
|
|
3
|
-
Official Ruby
|
|
3
|
+
Official Ruby client for the **Songstats Enterprise API**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
📦 RubyGems: https://rubygems.org/gems/songstats-ruby-sdk
|
|
6
|
+
📚 API Documentation: https://docs.songstats.com
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
---
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## Requirements
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
bundle install
|
|
13
|
-
bundle exec rake test
|
|
14
|
-
```
|
|
12
|
+
- Ruby >= 3.0
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
---
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Add to your `Gemfile`:
|
|
19
|
+
|
|
20
|
+
gem "songstats-ruby-sdk"
|
|
21
|
+
|
|
22
|
+
Then install:
|
|
23
|
+
|
|
24
|
+
bundle install
|
|
25
|
+
|
|
26
|
+
Or install directly via RubyGems:
|
|
27
|
+
|
|
28
|
+
gem install songstats-ruby-sdk
|
|
29
|
+
|
|
30
|
+
---
|
|
21
31
|
|
|
22
32
|
## Quick Start
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
require "songstats_sdk"
|
|
35
|
+
|
|
36
|
+
client = SongstatsSDK::Client.new(
|
|
37
|
+
api_key: ENV["SONGSTATS_API_KEY"]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# API status
|
|
41
|
+
status = client.info.status
|
|
26
42
|
|
|
27
|
-
|
|
43
|
+
# Track information
|
|
44
|
+
track = client.tracks.info(
|
|
45
|
+
songstats_track_id: "abcd1234"
|
|
46
|
+
)
|
|
28
47
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
# Artist statistics
|
|
49
|
+
artist_stats = client.artists.stats(
|
|
50
|
+
songstats_artist_id: "abcd1234",
|
|
51
|
+
source: "spotify"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
---
|
|
33
55
|
|
|
34
56
|
## Authentication
|
|
35
57
|
|
|
36
|
-
|
|
58
|
+
All requests include your API key in the `apikey` header.
|
|
59
|
+
|
|
60
|
+
You can generate an API key in your Songstats Enterprise dashboard.
|
|
61
|
+
|
|
62
|
+
We recommend storing your key securely in environment variables:
|
|
37
63
|
|
|
38
|
-
|
|
64
|
+
export SONGSTATS_API_KEY=your_key_here
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Available Resource Clients
|
|
39
69
|
|
|
40
70
|
- `client.info`
|
|
41
71
|
- `client.tracks`
|
|
42
72
|
- `client.artists`
|
|
43
73
|
- `client.collaborators`
|
|
44
74
|
- `client.labels`
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
|
|
76
|
+
Info endpoints:
|
|
77
|
+
- `client.info.sources` -> `/sources`
|
|
78
|
+
- `client.info.status` -> `/status`
|
|
79
|
+
- `client.info.definitions` -> `/definitions`
|
|
80
|
+
|
|
81
|
+
---
|
|
47
82
|
|
|
48
83
|
## Error Handling
|
|
49
84
|
|
|
50
|
-
|
|
51
|
-
|
|
85
|
+
begin
|
|
86
|
+
client.tracks.info(songstats_track_id: "invalid")
|
|
87
|
+
rescue SongstatsSDK::SongstatsAPIError => e
|
|
88
|
+
puts "API error: #{e.message}"
|
|
89
|
+
rescue SongstatsSDK::SongstatsTransportError => e
|
|
90
|
+
puts "Transport error: #{e.message}"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
To work on the SDK locally:
|
|
98
|
+
|
|
99
|
+
git clone https://github.com/songstats/songstats-ruby-sdk.git
|
|
100
|
+
cd songstats-ruby-sdk
|
|
101
|
+
bundle install
|
|
102
|
+
bundle exec rake test
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Versioning
|
|
107
|
+
|
|
108
|
+
This SDK follows Semantic Versioning (SemVer).
|
|
109
|
+
|
|
110
|
+
---
|
|
52
111
|
|
|
53
|
-
##
|
|
112
|
+
## License
|
|
54
113
|
|
|
55
|
-
|
|
114
|
+
MIT
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Enterprise Routes Audit (Songstats Rails -> Ruby SDK)
|
|
2
2
|
|
|
3
3
|
Audited against:
|
|
4
|
+
|
|
4
5
|
- `/Users/Oskar/1001tl/config/routes.rb`
|
|
5
6
|
- `/Users/Oskar/1001tl/app/controllers/enterprise/v1/*.rb`
|
|
6
7
|
- `/Users/Oskar/1001tl/app/helpers/enterprise_helper.rb`
|
|
@@ -9,110 +10,98 @@ Authentication observed in Rails: `apikey` request header.
|
|
|
9
10
|
|
|
10
11
|
## `/enterprise/v1/info`
|
|
11
12
|
|
|
12
|
-
| HTTP | Route
|
|
13
|
-
|
|
14
|
-
| GET
|
|
15
|
-
| GET
|
|
16
|
-
| GET
|
|
17
|
-
| GET
|
|
13
|
+
| HTTP | Route | SDK Method |
|
|
14
|
+
| ---- | --------------- | -------------------------- |
|
|
15
|
+
| GET | `/sources` | `client.info.sources` |
|
|
16
|
+
| GET | `/status` | `client.info.status` |
|
|
17
|
+
| GET | `/uptime_check` | `client.info.uptime_check` |
|
|
18
|
+
| GET | `/definitions` | `client.info.definitions` |
|
|
18
19
|
|
|
19
20
|
## `/enterprise/v1/tracks`
|
|
20
21
|
|
|
21
|
-
| HTTP
|
|
22
|
-
|
|
23
|
-
| GET
|
|
24
|
-
| GET
|
|
25
|
-
| GET
|
|
26
|
-
| GET
|
|
27
|
-
| GET
|
|
28
|
-
| GET
|
|
29
|
-
| GET
|
|
30
|
-
| GET
|
|
31
|
-
| POST
|
|
32
|
-
| DELETE | `/link_request`
|
|
33
|
-
| POST
|
|
22
|
+
| HTTP | Route | SDK Method |
|
|
23
|
+
| ------ | ----------------------------------- | ----------------------------------------------------- |
|
|
24
|
+
| GET | `/info` | `client.tracks.info(...)` |
|
|
25
|
+
| GET | `/stats` | `client.tracks.stats(...)` |
|
|
26
|
+
| GET | `/historic_stats` | `client.tracks.historic_stats(...)` |
|
|
27
|
+
| GET | `/search` | `client.tracks.search(q: ..., ...)` |
|
|
28
|
+
| GET | `/activities` | `client.tracks.activities(...)` |
|
|
29
|
+
| GET | `/comments` | `client.tracks.comments(...)` |
|
|
30
|
+
| GET | `/songshare` | `client.tracks.songshare(...)` |
|
|
31
|
+
| GET | `/locations` | `client.tracks.locations(...)` |
|
|
32
|
+
| POST | `/link_request` | `client.tracks.add_link_request(link: ..., ...)` |
|
|
33
|
+
| DELETE | `/link_request` | `client.tracks.remove_link_request(link: ..., ...)` |
|
|
34
|
+
| POST | `/add_to_member_relevant_list` | `client.tracks.add_to_member_relevant_list(...)` |
|
|
34
35
|
| DELETE | `/remove_from_member_relevant_list` | `client.tracks.remove_from_member_relevant_list(...)` |
|
|
35
36
|
|
|
36
|
-
## `/enterprise/v1/charts`
|
|
37
|
-
|
|
38
|
-
| HTTP | Route | SDK Method |
|
|
39
|
-
|---|---|---|
|
|
40
|
-
| GET | `/tracks` | `client.charts.tracks(country_code: ..., ...)` |
|
|
41
|
-
|
|
42
|
-
## `/enterprise/v1/stations`
|
|
43
|
-
|
|
44
|
-
| HTTP | Route | SDK Method |
|
|
45
|
-
|---|---|---|
|
|
46
|
-
| POST | `/station_request` | `client.stations.station_request(...)` |
|
|
47
|
-
|
|
48
37
|
## `/enterprise/v1/artists`
|
|
49
38
|
|
|
50
|
-
| HTTP
|
|
51
|
-
|
|
52
|
-
| GET
|
|
53
|
-
| GET
|
|
54
|
-
| GET
|
|
55
|
-
| GET
|
|
56
|
-
| GET
|
|
57
|
-
| GET
|
|
58
|
-
| GET
|
|
59
|
-
| GET
|
|
60
|
-
| GET
|
|
61
|
-
| GET
|
|
62
|
-
| GET
|
|
63
|
-
| GET
|
|
64
|
-
| GET
|
|
65
|
-
| POST
|
|
66
|
-
| DELETE | `/link_request`
|
|
67
|
-
| POST
|
|
68
|
-
| DELETE | `/track_request`
|
|
69
|
-
| POST
|
|
70
|
-
| DELETE | `/remove_from_member_relevant_list` | `client.artists.remove_from_member_relevant_list(...)`
|
|
39
|
+
| HTTP | Route | SDK Method |
|
|
40
|
+
| ------ | ----------------------------------- | --------------------------------------------------------- |
|
|
41
|
+
| GET | `/info` | `client.artists.info(...)` |
|
|
42
|
+
| GET | `/stats` | `client.artists.stats(...)` |
|
|
43
|
+
| GET | `/historic_stats` | `client.artists.historic_stats(...)` |
|
|
44
|
+
| GET | `/audience` | `client.artists.audience(...)` |
|
|
45
|
+
| GET | `/audience/details` | `client.artists.audience_details(country_code: ..., ...)` |
|
|
46
|
+
| GET | `/catalog` | `client.artists.catalog(...)` |
|
|
47
|
+
| GET | `/search` | `client.artists.search(q: ..., ...)` |
|
|
48
|
+
| GET | `/activities` | `client.artists.activities(...)` |
|
|
49
|
+
| GET | `/songshare` | `client.artists.songshare(...)` |
|
|
50
|
+
| GET | `/top_tracks` | `client.artists.top_tracks(...)` |
|
|
51
|
+
| GET | `/top_playlists` | `client.artists.top_playlists(...)` |
|
|
52
|
+
| GET | `/top_curators` | `client.artists.top_curators(...)` |
|
|
53
|
+
| GET | `/top_commentors` | `client.artists.top_commentors(...)` |
|
|
54
|
+
| POST | `/link_request` | `client.artists.add_link_request(link: ..., ...)` |
|
|
55
|
+
| DELETE | `/link_request` | `client.artists.remove_link_request(link: ..., ...)` |
|
|
56
|
+
| POST | `/track_request` | `client.artists.add_track_request(...)` |
|
|
57
|
+
| DELETE | `/track_request` | `client.artists.remove_track_request(...)` |
|
|
58
|
+
| POST | `/add_to_member_relevant_list` | `client.artists.add_to_member_relevant_list(...)` |
|
|
59
|
+
| DELETE | `/remove_from_member_relevant_list` | `client.artists.remove_from_member_relevant_list(...)` |
|
|
71
60
|
|
|
72
61
|
## `/enterprise/v1/collaborators`
|
|
73
62
|
|
|
74
|
-
| HTTP
|
|
75
|
-
|
|
76
|
-
| GET
|
|
77
|
-
| GET
|
|
78
|
-
| GET
|
|
79
|
-
| GET
|
|
80
|
-
| GET
|
|
81
|
-
| GET
|
|
82
|
-
| GET
|
|
83
|
-
| GET
|
|
84
|
-
| GET
|
|
85
|
-
| GET
|
|
86
|
-
| GET
|
|
87
|
-
| GET
|
|
88
|
-
| GET
|
|
89
|
-
| POST
|
|
90
|
-
| DELETE | `/link_request`
|
|
91
|
-
| POST
|
|
92
|
-
| DELETE | `/track_request`
|
|
93
|
-
| POST
|
|
94
|
-
| DELETE | `/remove_from_member_relevant_list` | `client.collaborators.remove_from_member_relevant_list(...)`
|
|
63
|
+
| HTTP | Route | SDK Method |
|
|
64
|
+
| ------ | ----------------------------------- | --------------------------------------------------------------- |
|
|
65
|
+
| GET | `/info` | `client.collaborators.info(...)` |
|
|
66
|
+
| GET | `/stats` | `client.collaborators.stats(...)` |
|
|
67
|
+
| GET | `/historic_stats` | `client.collaborators.historic_stats(...)` |
|
|
68
|
+
| GET | `/audience` | `client.collaborators.audience(...)` |
|
|
69
|
+
| GET | `/audience/details` | `client.collaborators.audience_details(country_code: ..., ...)` |
|
|
70
|
+
| GET | `/catalog` | `client.collaborators.catalog(...)` |
|
|
71
|
+
| GET | `/search` | `client.collaborators.search(q: ..., ...)` |
|
|
72
|
+
| GET | `/activities` | `client.collaborators.activities(...)` |
|
|
73
|
+
| GET | `/songshare` | `client.collaborators.songshare(...)` |
|
|
74
|
+
| GET | `/top_tracks` | `client.collaborators.top_tracks(...)` |
|
|
75
|
+
| GET | `/top_playlists` | `client.collaborators.top_playlists(...)` |
|
|
76
|
+
| GET | `/top_curators` | `client.collaborators.top_curators(...)` |
|
|
77
|
+
| GET | `/top_commentors` | `client.collaborators.top_commentors(...)` |
|
|
78
|
+
| POST | `/link_request` | `client.collaborators.add_link_request(link: ..., ...)` |
|
|
79
|
+
| DELETE | `/link_request` | `client.collaborators.remove_link_request(link: ..., ...)` |
|
|
80
|
+
| POST | `/track_request` | `client.collaborators.add_track_request(...)` |
|
|
81
|
+
| DELETE | `/track_request` | `client.collaborators.remove_track_request(...)` |
|
|
82
|
+
| POST | `/add_to_member_relevant_list` | `client.collaborators.add_to_member_relevant_list(...)` |
|
|
83
|
+
| DELETE | `/remove_from_member_relevant_list` | `client.collaborators.remove_from_member_relevant_list(...)` |
|
|
95
84
|
|
|
96
85
|
## `/enterprise/v1/labels`
|
|
97
86
|
|
|
98
|
-
| HTTP
|
|
99
|
-
|
|
100
|
-
| GET
|
|
101
|
-
| GET
|
|
102
|
-
| GET
|
|
103
|
-
| GET
|
|
104
|
-
| GET
|
|
105
|
-
| GET
|
|
106
|
-
| GET
|
|
107
|
-
| GET
|
|
108
|
-
| GET
|
|
109
|
-
| GET
|
|
110
|
-
| GET
|
|
111
|
-
| GET
|
|
112
|
-
| GET
|
|
113
|
-
| POST
|
|
114
|
-
| DELETE | `/link_request`
|
|
115
|
-
| POST
|
|
116
|
-
| DELETE | `/track_request`
|
|
117
|
-
| POST
|
|
118
|
-
| DELETE | `/remove_from_member_relevant_list` | `client.labels.remove_from_member_relevant_list(...)`
|
|
87
|
+
| HTTP | Route | SDK Method |
|
|
88
|
+
| ------ | ----------------------------------- | -------------------------------------------------------- |
|
|
89
|
+
| GET | `/info` | `client.labels.info(...)` |
|
|
90
|
+
| GET | `/stats` | `client.labels.stats(...)` |
|
|
91
|
+
| GET | `/historic_stats` | `client.labels.historic_stats(...)` |
|
|
92
|
+
| GET | `/audience` | `client.labels.audience(...)` |
|
|
93
|
+
| GET | `/audience/details` | `client.labels.audience_details(country_code: ..., ...)` |
|
|
94
|
+
| GET | `/catalog` | `client.labels.catalog(...)` |
|
|
95
|
+
| GET | `/search` | `client.labels.search(q: ..., ...)` |
|
|
96
|
+
| GET | `/activities` | `client.labels.activities(...)` |
|
|
97
|
+
| GET | `/songshare` | `client.labels.songshare(...)` |
|
|
98
|
+
| GET | `/top_tracks` | `client.labels.top_tracks(...)` |
|
|
99
|
+
| GET | `/top_playlists` | `client.labels.top_playlists(...)` |
|
|
100
|
+
| GET | `/top_curators` | `client.labels.top_curators(...)` |
|
|
101
|
+
| GET | `/top_commentors` | `client.labels.top_commentors(...)` |
|
|
102
|
+
| POST | `/link_request` | `client.labels.add_link_request(link: ..., ...)` |
|
|
103
|
+
| DELETE | `/link_request` | `client.labels.remove_link_request(link: ..., ...)` |
|
|
104
|
+
| POST | `/track_request` | `client.labels.add_track_request(...)` |
|
|
105
|
+
| DELETE | `/track_request` | `client.labels.remove_track_request(...)` |
|
|
106
|
+
| POST | `/add_to_member_relevant_list` | `client.labels.add_to_member_relevant_list(...)` |
|
|
107
|
+
| DELETE | `/remove_from_member_relevant_list` | `client.labels.remove_from_member_relevant_list(...)` |
|
data/lib/songstats_sdk/client.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module SongstatsSDK
|
|
4
4
|
class Client
|
|
5
|
-
attr_reader :info, :tracks, :artists, :collaborators, :labels
|
|
5
|
+
attr_reader :info, :tracks, :artists, :collaborators, :labels
|
|
6
6
|
|
|
7
7
|
def initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS,
|
|
8
8
|
max_retries: 2, http_adapter: nil, user_agent: nil)
|
|
@@ -20,8 +20,6 @@ module SongstatsSDK
|
|
|
20
20
|
@artists = Resources::Artists.new(@http)
|
|
21
21
|
@collaborators = Resources::Collaborators.new(@http)
|
|
22
22
|
@labels = Resources::Labels.new(@http)
|
|
23
|
-
@charts = Resources::Charts.new(@http)
|
|
24
|
-
@stations = Resources::Stations.new(@http)
|
|
25
23
|
end
|
|
26
24
|
|
|
27
25
|
def close
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: songstats-ruby-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Songstats
|
|
@@ -10,7 +10,7 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2026-02-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description: Typed Ruby client
|
|
13
|
+
description: Typed Ruby client for Songstats Enterprise API resources.
|
|
14
14
|
email:
|
|
15
15
|
- api@songstats.com
|
|
16
16
|
executables: []
|
|
@@ -27,10 +27,8 @@ files:
|
|
|
27
27
|
- lib/songstats_sdk/http_client.rb
|
|
28
28
|
- lib/songstats_sdk/resources.rb
|
|
29
29
|
- lib/songstats_sdk/resources/base.rb
|
|
30
|
-
- lib/songstats_sdk/resources/charts.rb
|
|
31
30
|
- lib/songstats_sdk/resources/entities.rb
|
|
32
31
|
- lib/songstats_sdk/resources/info.rb
|
|
33
|
-
- lib/songstats_sdk/resources/stations.rb
|
|
34
32
|
- lib/songstats_sdk/resources/tracks.rb
|
|
35
33
|
- lib/songstats_sdk/version.rb
|
|
36
34
|
homepage: https://songstats.com
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module SongstatsSDK
|
|
4
|
-
module Resources
|
|
5
|
-
class Charts < Base
|
|
6
|
-
def tracks(country_code:, source: nil, **params)
|
|
7
|
-
raise ArgumentError, "country_code is required" if country_code.to_s.empty?
|
|
8
|
-
|
|
9
|
-
query = { country_code: country_code, source: source }.merge(params)
|
|
10
|
-
get("charts/tracks", params: query)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module SongstatsSDK
|
|
4
|
-
module Resources
|
|
5
|
-
class Stations < Base
|
|
6
|
-
def station_request(radio_type:, name:, country_code:, website:, stream_url: nil, city_name: nil, frequency: nil,
|
|
7
|
-
contact: nil, comment: nil, **extra)
|
|
8
|
-
raise ArgumentError, "radio_type is required" if radio_type.to_s.empty?
|
|
9
|
-
raise ArgumentError, "name is required" if name.to_s.empty?
|
|
10
|
-
raise ArgumentError, "country_code is required" if country_code.to_s.empty?
|
|
11
|
-
raise ArgumentError, "website is required" if website.to_s.empty?
|
|
12
|
-
|
|
13
|
-
payload = {
|
|
14
|
-
radio_type: radio_type,
|
|
15
|
-
name: name,
|
|
16
|
-
country_code: country_code,
|
|
17
|
-
website: website,
|
|
18
|
-
stream_url: stream_url,
|
|
19
|
-
city_name: city_name,
|
|
20
|
-
frequency: frequency,
|
|
21
|
-
contact: contact,
|
|
22
|
-
comment: comment
|
|
23
|
-
}.merge(extra)
|
|
24
|
-
|
|
25
|
-
post("stations/station_request", json: payload)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|