podcast_api 1.0.3 → 1.1.1

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.
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- podcast_api (1.0.1)
4
+ podcast_api (1.1.1)
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
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.3"
4
+ VERSION = "1.1.1"
5
5
  end
data/podcast_api.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.required_ruby_version = ">= 2.3.0"
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
+ "This is the official Ruby Gem for the Listen Notes Podcast API. " \
13
14
  "See https://www.listennotes.com/api/ for details."
14
15
  s.author = "Listen Notes, Inc."
15
16
  s.email = "hello@listennotes.com"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podcast_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.1
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-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -24,7 +24,8 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: Listen Notes is the best podcast search engine and api. See https://www.listennotes.com/api/
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
29
  for details.
29
30
  email: hello@listennotes.com
30
31
  executables: []
@@ -69,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
70
  - !ruby/object:Gem::Version
70
71
  version: '0'
71
72
  requirements: []
72
- rubygems_version: 3.0.3
73
+ rubygems_version: 3.0.3.1
73
74
  signing_key:
74
75
  specification_version: 4
75
76
  summary: Ruby bindings for the Listen Notes Podcast API