Skip to content

Commit 1476a71

Browse files
committed
Add new endpoint fetch_podcasts_by_domain
1 parent c69fc7d commit 1476a71

File tree

7 files changed

+3664
-2830
lines changed

7 files changed

+3664
-2830
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
podcast_api (1.1.4)
4+
podcast_api (1.1.5)
55
httparty (~> 0.20.0)
66

77
GEM
@@ -12,7 +12,7 @@ GEM
1212
multi_xml (>= 0.5.2)
1313
mime-types (3.4.1)
1414
mime-types-data (~> 3.2015)
15-
mime-types-data (3.2022.0105)
15+
mime-types-data (3.2023.0218.1)
1616
mocha (1.12.0)
1717
multi_xml (0.6.0)
1818
power_assert (2.0.0)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Listen Notes
3+
Copyright (c) 2023 Listen Notes
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3643 additions & 2823 deletions
Large diffs are not rendered by default.

examples/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PATH
22
remote: ..
33
specs:
4-
podcast_api (1.1.4)
5-
httparty
4+
podcast_api (1.1.5)
5+
httparty (~> 0.20.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -12,7 +12,7 @@ GEM
1212
multi_xml (>= 0.5.2)
1313
mime-types (3.4.1)
1414
mime-types-data (~> 3.2015)
15-
mime-types-data (3.2022.0105)
15+
mime-types-data (3.2023.0218.1)
1616
multi_xml (0.6.0)
1717

1818
PLATFORMS

lib/podcast_api.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ def delete_podcast(**kwargs)
154154
def fetch_audience_for_podcast(**kwargs)
155155
id = kwargs.delete(:id)
156156
return send_http_request('get', "#{@base_url}/podcasts/#{id}/audience", {query: kwargs, headers: @headers})
157+
end
158+
159+
def fetch_podcasts_by_domain(**kwargs)
160+
domain_name = kwargs.delete(:domain_name)
161+
return send_http_request('get', "#{@base_url}/podcasts/domains/#{domain_name}", {query: kwargs, headers: @headers})
157162
end
158163
end
159164

lib/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PodcastApi
4-
VERSION = "1.1.4"
4+
VERSION = "1.1.5"
55
end

tests/podcast_api_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,13 @@ def test_fetch_audience_for_podcast_with_mock
221221
assert_equal response.request.path.path, "/api/v2/podcasts/#{id}/audience"
222222
assert response['by_regions'].length > 0
223223
end
224+
225+
def test_fetch_podcasts_by_domain_with_mock
226+
domain_name = 'npr.org'
227+
client = PodcastApi::Client.new
228+
response = client.fetch_podcasts_by_domain(domain_name: domain_name, page: 3)
229+
assert_equal response.request.http_method, Net::HTTP::Get
230+
assert_equal response.request.path.path, "/api/v2/podcasts/domains/#{domain_name}"
231+
assert response['podcasts'].length > 0
232+
end
224233
end

0 commit comments

Comments
 (0)