podcast_api 1.1.6 → 3.0.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/README.md +534 -12687
- data/lib/api-contract.json +911 -0
- data/lib/api_methods.rb +157 -0
- data/lib/errors.rb +14 -18
- data/lib/podcast_api.rb +73 -157
- data/lib/version.rb +2 -2
- metadata +17 -20
- data/Gemfile +0 -12
- data/Gemfile.lock +0 -34
- data/RakeFile +0 -9
- data/examples/Gemfile +0 -3
- data/examples/Gemfile.lock +0 -25
- data/examples/sample.rb +0 -85
- data/podcast_api.gemspec +0 -41
- data/rakefile.rb +0 -9
data/examples/sample.rb
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
require "podcast_api"
|
|
2
|
-
|
|
3
|
-
api_key = ENV["LISTEN_API_KEY"]
|
|
4
|
-
client = PodcastApi::Client.new(api_key: api_key)
|
|
5
|
-
|
|
6
|
-
begin
|
|
7
|
-
response = client.search(q: 'startup')
|
|
8
|
-
puts JSON.parse(response.body)
|
|
9
|
-
rescue PodcastApi::AuthenticationError
|
|
10
|
-
puts 'Wrong api key'
|
|
11
|
-
rescue PodcastApi::InvalidRequestError
|
|
12
|
-
puts 'Client side errors, e.g., wrong parameters'
|
|
13
|
-
rescue PodcastApi::NotFoundError
|
|
14
|
-
puts 'Not found'
|
|
15
|
-
rescue PodcastApi::RateLimitError
|
|
16
|
-
puts 'Reached quota limit or rate limit'
|
|
17
|
-
rescue PodcastApi::APIConnectionError
|
|
18
|
-
puts 'Failed to connect to Listen API servers'
|
|
19
|
-
rescue PodcastApi::PodcastApiError
|
|
20
|
-
puts 'Server side errors'
|
|
21
|
-
else
|
|
22
|
-
puts "Free Quota per month: #{response.headers['X-ListenAPI-FreeQuota']}"
|
|
23
|
-
puts "Usage this month: #{response.headers['X-ListenAPI-Usage']}"
|
|
24
|
-
puts "Next billing date: #{response.headers['X-Listenapi-NextBillingDate']}"
|
|
25
|
-
end
|
|
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)
|
|
35
|
-
|
|
36
|
-
# response = client.typeahead(q: 'startup', show_podcasts: 1)
|
|
37
|
-
# puts JSON.parse(response.body)
|
|
38
|
-
|
|
39
|
-
# response = client.fetch_best_podcasts()
|
|
40
|
-
# puts JSON.parse(response.body)
|
|
41
|
-
|
|
42
|
-
# response = client.fetch_podcast_by_id(id: '4d3fe717742d4963a85562e9f84d8c79')
|
|
43
|
-
# puts JSON.parse(response.body)
|
|
44
|
-
|
|
45
|
-
# response = client.fetch_episode_by_id(id: '6b6d65930c5a4f71b254465871fed370')
|
|
46
|
-
# puts JSON.parse(response.body)
|
|
47
|
-
|
|
48
|
-
# response = client.batch_fetch_podcasts(ids: '3302bc71139541baa46ecb27dbf6071a,68faf62be97149c280ebcc25178aa731,37589a3e121e40debe4cef3d9638932a,9cf19c590ff0484d97b18b329fed0c6a')
|
|
49
|
-
# puts JSON.parse(response.body)
|
|
50
|
-
|
|
51
|
-
# response = client.batch_fetch_episodes(ids: 'c577d55b2b2b483c969fae3ceb58e362,0f34a9099579490993eec9e8c8cebb82')
|
|
52
|
-
# puts JSON.parse(response.body)
|
|
53
|
-
|
|
54
|
-
# response = client.fetch_curated_podcasts_list_by_id(id: 'SDFKduyJ47r')
|
|
55
|
-
# puts JSON.parse(response.body)
|
|
56
|
-
|
|
57
|
-
# response = client.fetch_podcast_genres()
|
|
58
|
-
# puts JSON.parse(response.body)
|
|
59
|
-
|
|
60
|
-
# response = client.fetch_podcast_regions()
|
|
61
|
-
# puts JSON.parse(response.body)
|
|
62
|
-
|
|
63
|
-
# response = client.fetch_podcast_languages()
|
|
64
|
-
# puts JSON.parse(response.body)
|
|
65
|
-
|
|
66
|
-
# response = client.just_listen()
|
|
67
|
-
# puts JSON.parse(response.body)
|
|
68
|
-
|
|
69
|
-
# response = client.fetch_recommendations_for_podcast(id: '25212ac3c53240a880dd5032e547047b')
|
|
70
|
-
# puts JSON.parse(response.body)
|
|
71
|
-
|
|
72
|
-
# response = client.fetch_recommendations_for_episode(id: '914a9deafa5340eeaa2859c77f275799')
|
|
73
|
-
# puts JSON.parse(response.body)
|
|
74
|
-
|
|
75
|
-
# response = client.fetch_playlist_by_id(id: 'm1pe7z60bsw')
|
|
76
|
-
# puts JSON.parse(response.body)
|
|
77
|
-
|
|
78
|
-
# response = client.fetch_my_playlists()
|
|
79
|
-
# puts JSON.parse(response.body)
|
|
80
|
-
|
|
81
|
-
# response = client.submit_podcast(rss: 'https://feeds.megaphone.fm/committed')
|
|
82
|
-
# puts JSON.parse(response.body)
|
|
83
|
-
|
|
84
|
-
# response = client.delete_podcast(id: '4d3fe717742d4963a85562e9f84d8c79')
|
|
85
|
-
# puts JSON.parse(response.body)
|
data/podcast_api.gemspec
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
$LOAD_PATH.unshift(::File.join(::File.dirname(__FILE__), "lib"))
|
|
4
|
-
|
|
5
|
-
require "version"
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = "podcast_api"
|
|
9
|
-
s.version = PodcastApi::VERSION
|
|
10
|
-
s.required_ruby_version = ">= 2.3.0"
|
|
11
|
-
s.summary = "Ruby bindings for the Listen Notes Podcast API"
|
|
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. " \
|
|
14
|
-
"See https://www.PodcastAPI.com/ for details."
|
|
15
|
-
s.author = "Listen Notes, Inc."
|
|
16
|
-
s.email = "hello@listennotes.com"
|
|
17
|
-
s.homepage = "https://www.PodcastAPI.com/"
|
|
18
|
-
s.license = "MIT"
|
|
19
|
-
s.add_runtime_dependency "httparty", '~> 0.20.0'
|
|
20
|
-
s.metadata = {
|
|
21
|
-
"bug_tracker_uri" => "https://github.com/ListenNotes/podcast-api-ruby/issues",
|
|
22
|
-
"changelog_uri" =>
|
|
23
|
-
"https://github.com/ListenNotes/podcast-api-ruby/releases",
|
|
24
|
-
"documentation_uri" => "https://www.listennotes.com/podcast-api/docs/",
|
|
25
|
-
"github_repo" => "https://github.com/ListenNotes/podcast-api-ruby",
|
|
26
|
-
"homepage_uri" => "https://www.PodcastAPI.com/",
|
|
27
|
-
"source_code_uri" => "https://github.com/ListenNotes/podcast-api-ruby",
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ignored = Regexp.union(
|
|
31
|
-
/\A\.editorconfig/,
|
|
32
|
-
/\A\.git/,
|
|
33
|
-
/\A\.rubocop/,
|
|
34
|
-
/\A\.travis.yml/,
|
|
35
|
-
/\Atest/
|
|
36
|
-
)
|
|
37
|
-
s.files = `git ls-files`.split("\n").reject { |f| ignored.match(f) }
|
|
38
|
-
s.executables = `git ls-files -- bin/*`.split("\n")
|
|
39
|
-
.map { |f| ::File.basename(f) }
|
|
40
|
-
s.require_paths = ["lib"]
|
|
41
|
-
end
|