podkasto-api

A Go package to interact with PodcastIndex.org
git clone git://git.swab.dev/podkasto-api.git
Log | Files | Refs | README | LICENSE

commit 8153eca32f9953891da17749619529f42b29ac70
parent 839713891118956ea251b13350bbd0e8f3096d7f
Author: Jaron Swab <jaron@swab.dev>
Date:   Mon, 26 Apr 2021 21:16:45 -0400

Added missing API struct and fixed typos

Diffstat:
Msearch/common.go | 6++++++
Msearch/podcasts.go | 6+++---
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/search/common.go b/search/common.go @@ -1,5 +1,11 @@ package search +// API contains the API Key and Secret for sending requests to PodcastIndex.org +type API struct { + ApiKey string + ApiSecret string +} + func getData(query string) string { body, err := request.Send(searchQuery, q.ApiKey, q.ApiSecret) if err != nil { diff --git a/search/podcasts.go b/search/podcasts.go @@ -31,16 +31,16 @@ func (q *API) ByFeedURL(URL string) (string, error) { } // ByTag returns all feeds that support the specified podcast namespace tag. -func (q *API) ByTag() (string, err) { +func (q *API) ByTag() (string, error) { return getData(url.QueryEscape(fmt.Sprintf("podcasts/bytag?podcast-value"))) } // Trending returns the podcasts/feeds that in the index that are trending. -func (q *API) Trending() (string, err) { +func (q *API) Trending() (string, error) { return getData(url.QueryEscape(fmt.Sprintf("podcasts/trending"))) } // Dead returns all feeds that have been marked dead. -func (q *API) Dead() (string, err) { +func (q *API) Dead() (string, error) { return getData(url.QueryEscape(fmt.Sprintf("podcasts/dead"))) }