aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.go b/main.go
index 5a2bd3e..6769385 100644
--- a/main.go
+++ b/main.go
@@ -154,10 +154,14 @@ func populateFeed(feed *feeds.Feed, page []byte) {
func describeFeed(feed *feeds.Feed, wg *sync.WaitGroup) {
defer wg.Done()
programAboutUrl := strings.TrimSuffix(feed.Link.Href, "episodes") + "about"
- programAboutPage := getPage(programAboutUrl)
- programAbout := programAboutRe.FindSubmatch(programAboutPage)[1]
+ page := getPage(programAboutUrl)
+ feed.Description = processFeedDesc(page)
+}
+
+func processFeedDesc(page []byte) string {
+ programAbout := programAboutRe.FindSubmatch(page)[1]
re := regexp.MustCompile(`<(.+?)?>`)
- feed.Description = string(re.ReplaceAll(programAbout, []byte(``)))
+ return string(re.ReplaceAll(programAbout, []byte(``)))
}
func describeEpisodes(feed *feeds.Feed) {