Class: PodcastIndex::Api::Podcasts

Inherits:
Object
  • Object
show all
Extended by:
Request
Defined in:
lib/podcast_index/api/podcasts.rb

Class Method Summary collapse

Methods included from Request

get

Class Method Details

.by_feed_id(id:) ⇒ Object



7
8
9
10
# File 'lib/podcast_index/api/podcasts.rb', line 7

def by_feed_id(id:)
  response = get("/podcasts/byfeedid", id: id)
  JSON.parse(response.body)
end

.by_feed_url(url:) ⇒ Object



12
13
14
15
# File 'lib/podcast_index/api/podcasts.rb', line 12

def by_feed_url(url:)
  response = get("/podcasts/byfeedurl", url: url)
  JSON.parse(response.body)
end

.by_guid(guid:) ⇒ Object



22
23
24
25
# File 'lib/podcast_index/api/podcasts.rb', line 22

def by_guid(guid:)
  response = get("/podcasts/byguid", guid: guid)
  JSON.parse(response.body)
end

.by_itunes_id(id:) ⇒ Object



17
18
19
20
# File 'lib/podcast_index/api/podcasts.rb', line 17

def by_itunes_id(id:)
  response = get("/podcasts/byitunesid", id: id)
  JSON.parse(response.body)
end

.by_medium(medium:) ⇒ Object



33
34
35
36
# File 'lib/podcast_index/api/podcasts.rb', line 33

def by_medium(medium:)
  response = get("/podcasts/bymedium", medium: medium)
  JSON.parse(response.body)
end

.by_tag(tag:) ⇒ Object



27
28
29
30
31
# File 'lib/podcast_index/api/podcasts.rb', line 27

def by_tag(tag:)
  params = {}.tap { |p| p[tag] = true }
  response = get("/podcasts/bytag", params)
  JSON.parse(response.body)
end

.deadObject



43
44
45
46
# File 'lib/podcast_index/api/podcasts.rb', line 43

def dead
  response = get("/podcasts/dead", {})
  JSON.parse(response.body)
end


38
39
40
41
# File 'lib/podcast_index/api/podcasts.rb', line 38

def trending(max: nil, since: nil, lang: nil, cat: nil, notcat: nil)
  response = get("/podcasts/trending", max: max, since: since, lang: lang, cat: cat, notcat: notcat)
  JSON.parse(response.body)
end