summaryrefslogtreecommitdiffstats
path: root/schema/schema.go
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-11-25 20:53:54 -0500
committersiddharth ravikumar <s@ricketyspace.net>2022-11-25 20:53:54 -0500
commit6196d58a8d6d432d799736fc9cf6740229f021c3 (patch)
treec8dcae340e02853cff174aa0c70fb047a1420979 /schema/schema.go
parent43ea9acb421baa6f3379af9ae4508dfb4bf339ab (diff)
schema: add `PodcastFeed`
Diffstat (limited to 'schema/schema.go')
-rw-r--r--schema/schema.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/schema/schema.go b/schema/schema.go
index c114fb1..e0712a3 100644
--- a/schema/schema.go
+++ b/schema/schema.go
@@ -61,6 +61,28 @@ type YouTubeFeed struct {
Entries []YouTubeEntry `xml:"entry"`
}
+// Represents a direct link to a Podcast.
+type PodcastLink struct {
+ XMLName xml.Name `xml:"enclosure"`
+ Url string `xml:"url,attr"`
+}
+
+// Represents an entry in the Podcast feed.
+type PodcastEntry struct {
+ XMLName xml.Name `xml:"item"`
+ Id string `xml:"guid"`
+ Title string `xml:"title"`
+ Pub string `xml:"pubDate"`
+ PubTime time.Time
+ Link PodcastLink `xml:"enclosure"`
+}
+
+// Represents a iTunes Podcast feed.
+type PodcastFeed struct {
+ XMLName xml.Name `xml:"rss"`
+ Entries []PodcastEntry `xml:"channel>item"`
+}
+
func (e Entry) TitleContains(contains string) bool {
return strings.Contains(strings.ToLower(e.Title), strings.ToLower(contains))
}