aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorEvgeny Kuznetsov <evgeny@kuznetsov.md>2022-05-01 12:09:00 +0300
committerEvgeny Kuznetsov <evgeny@kuznetsov.md>2022-05-01 12:09:00 +0300
commit9d6b876b406a0a40eb62d2da03d7f15d813ca7d6 (patch)
treef607883ea1d2eb6001fbf5a6664fccf09afc185a /main.go
parentb40a94f0f128e532a338cf20aeb88d0a6873e589 (diff)
downloadradiorus-rss-9d6b876b406a0a40eb62d2da03d7f15d813ca7d6.tar.gz
radiorus-rss-9d6b876b406a0a40eb62d2da03d7f15d813ca7d6.zip
add option to use smotrim.ru directly
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 24cdcb6..0aeafab 100644
--- a/main.go
+++ b/main.go
@@ -51,6 +51,7 @@ var (
episodeUrlRe = regexp.MustCompile(`<a href="/brand/(.+?)?" class="title`)
outputPath, programNumber string
+ smotrim bool
errBadEpisode = fmt.Errorf("bad episode")
errCantParse = fmt.Errorf("could not parse page")
@@ -61,9 +62,13 @@ var (
func main() {
flag.StringVar(&outputPath, "path", "./", "path to put resulting RSS file in")
flag.StringVar(&programNumber, "brand", "57083", "brand number (defaults to Aerostat)")
+ flag.BoolVar(&smotrim, "smotrim", false, "use smotrim.ru directly")
flag.Parse()
url := "https://www.radiorus.ru/brand/" + programNumber + "/episodes"
+ if smotrim {
+ url = "https://smotrim.ru/brand/" + programNumber
+ }
feed := processURL(url)