podcast_api 1.0.4 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- podcast_api (1.0.1)
4
+ podcast_api (1.1.4)
5
5
  httparty
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- httparty (0.18.1)
10
+ httparty (0.20.0)
11
11
  mime-types (~> 3.0)
12
12
  multi_xml (>= 0.5.2)
13
- mime-types (3.3.1)
13
+ mime-types (3.4.1)
14
14
  mime-types-data (~> 3.2015)
15
- mime-types-data (3.2021.0225)
15
+ mime-types-data (3.2022.0105)
16
16
  multi_xml (0.6.0)
17
17
 
18
18
  PLATFORMS
data/examples/sample.rb CHANGED
@@ -13,7 +13,7 @@ rescue PodcastApi::InvalidRequestError
13
13
  rescue PodcastApi::NotFoundError
14
14
  puts 'Not found'
15
15
  rescue PodcastApi::RateLimitError
16
- puts 'Reached quota limit'
16
+ puts 'Reached quota limit or rate limit'
17
17
  rescue PodcastApi::APIConnectionError
18
18
  puts 'Failed to connect to Listen API servers'
19
19
  rescue PodcastApi::PodcastApiError
@@ -24,6 +24,14 @@ else
24
24
  puts "Next billing date: #{response.headers['X-Listenapi-NextBillingDate']}"
25
25
  end
26
26
 
27
+ # response = client.spellcheck(q: 'evergrand stok')
28
+ # puts JSON.parse(response.body)
29
+
30
+ # response = client.fetch_related_searches(q: 'evergrande')
31
+ # puts JSON.parse(response.body)
32
+
33
+ # response = client.fetch_trending_searches()
34
+ # puts JSON.parse(response.body)
27
35
 
28
36
  # response = client.typeahead(q: 'startup', show_podcasts: 1)
29
37
  # puts JSON.parse(response.body)
data/lib/podcast_api.rb CHANGED
@@ -36,7 +36,7 @@ module PodcastApi
36
36
  elsif response.code == 404
37
37
  raise NotFoundError.new 'endpoint not exist, or podcast / episode not exist'
38
38
  elsif response.code == 429
39
- raise RateLimitError.new 'you are using FREE plan and you exceed the quota limit'
39
+ raise RateLimitError.new 'for FREE plan, exceeding the quota limit; or for all plans, sending too many requests too fast and exceeding the rate limit - https://www.listennotes.com/api/faq/#faq17'
40
40
  else
41
41
  raise PodcastApiError.new 'something wrong on our end (unexpected server errors)'
42
42
  end
@@ -61,6 +61,18 @@ module PodcastApi
61
61
  return send_http_request('get', "#{@base_url}/typeahead", {query: kwargs, headers: @headers})
62
62
  end
63
63
 
64
+ def spellcheck(**kwargs)
65
+ return send_http_request('get', "#{@base_url}/spellcheck", {query: kwargs, headers: @headers})
66
+ end
67
+
68
+ def fetch_related_searches(**kwargs)
69
+ return send_http_request('get', "#{@base_url}/related_searches", {query: kwargs, headers: @headers})
70
+ end
71
+
72
+ def fetch_trending_searches(**kwargs)
73
+ return send_http_request('get', "#{@base_url}/trending_searches", {query: kwargs, headers: @headers})
74
+ end
75
+
64
76
  def fetch_best_podcasts(**kwargs)
65
77
  return send_http_request('get', "#{@base_url}/best_podcasts", {query: kwargs, headers: @headers})
66
78
  end
@@ -137,6 +149,11 @@ module PodcastApi
137
149
  def delete_podcast(**kwargs)
138
150
  id = kwargs.delete(:id)
139
151
  return send_http_request('delete', "#{@base_url}/podcasts/#{id}", {query: kwargs, headers: @headers})
152
+ end
153
+
154
+ def fetch_audience_for_podcast(**kwargs)
155
+ id = kwargs.delete(:id)
156
+ return send_http_request('get', "#{@base_url}/podcasts/#{id}/audience", {query: kwargs, headers: @headers})
140
157
  end
141
158
  end
142
159
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PodcastApi
4
- VERSION = "1.0.4"
4
+ VERSION = "1.1.4"
5
5
  end
data/podcast_api.gemspec CHANGED
@@ -11,19 +11,19 @@ Gem::Specification.new do |s|
11
11
  s.summary = "Ruby bindings for the Listen Notes Podcast API"
12
12
  s.description = "Listen Notes is the best podcast search engine and api. " \
13
13
  "This is the official Ruby Gem for the Listen Notes Podcast API. " \
14
- "See https://www.listennotes.com/api/ for details."
14
+ "See https://www.PodcastAPI.com/ for details."
15
15
  s.author = "Listen Notes, Inc."
16
16
  s.email = "hello@listennotes.com"
17
- s.homepage = "https://www.listennotes.com/api/"
17
+ s.homepage = "https://www.PodcastAPI.com/"
18
18
  s.license = "MIT"
19
- s.add_runtime_dependency "httparty"
19
+ s.add_runtime_dependency "httparty", '~> 0.20.0'
20
20
  s.metadata = {
21
21
  "bug_tracker_uri" => "https://github.com/ListenNotes/podcast-api-ruby/issues",
22
22
  "changelog_uri" =>
23
23
  "https://github.com/ListenNotes/podcast-api-ruby/releases",
24
- "documentation_uri" => "https://www.listennotes.com/api/docs/",
24
+ "documentation_uri" => "https://www.listennotes.com/podcast-api/docs/",
25
25
  "github_repo" => "https://github.com/ListenNotes/podcast-api-ruby",
26
- "homepage_uri" => "https://www.listennotes.com/api/",
26
+ "homepage_uri" => "https://www.PodcastAPI.com/",
27
27
  "source_code_uri" => "https://github.com/ListenNotes/podcast-api-ruby",
28
28
  }
29
29
 
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podcast_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Listen Notes, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2022-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.20.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.20.0
27
27
  description: Listen Notes is the best podcast search engine and api. This is the
28
- official Ruby Gem for the Listen Notes Podcast API. See https://www.listennotes.com/api/
28
+ official Ruby Gem for the Listen Notes Podcast API. See https://www.PodcastAPI.com/
29
29
  for details.
30
30
  email: hello@listennotes.com
31
31
  executables: []
@@ -45,15 +45,15 @@ files:
45
45
  - lib/version.rb
46
46
  - podcast_api.gemspec
47
47
  - rakefile.rb
48
- homepage: https://www.listennotes.com/api/
48
+ homepage: https://www.PodcastAPI.com/
49
49
  licenses:
50
50
  - MIT
51
51
  metadata:
52
52
  bug_tracker_uri: https://github.com/ListenNotes/podcast-api-ruby/issues
53
53
  changelog_uri: https://github.com/ListenNotes/podcast-api-ruby/releases
54
- documentation_uri: https://www.listennotes.com/api/docs/
54
+ documentation_uri: https://www.listennotes.com/podcast-api/docs/
55
55
  github_repo: https://github.com/ListenNotes/podcast-api-ruby
56
- homepage_uri: https://www.listennotes.com/api/
56
+ homepage_uri: https://www.PodcastAPI.com/
57
57
  source_code_uri: https://github.com/ListenNotes/podcast-api-ruby
58
58
  post_install_message:
59
59
  rdoc_options: []
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.0.3
73
+ rubygems_version: 3.0.3.1
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Ruby bindings for the Listen Notes Podcast API