Skip to content

Commit

Permalink
add https scheme if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
piqoni committed Sep 24, 2024
1 parent fddd56c commit 223613f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"net/url"
"os/exec"
"runtime"
"time"
Expand Down Expand Up @@ -149,6 +150,11 @@ func fetchWebsite(url string, updateTextChan chan<- string) {
}

func fetchRSSArticles(feedURL string) (urls []string, titles []string) {
parsedUrl, err := url.Parse(feedURL)
if err != nil || parsedUrl.Scheme == "" {
feedURL = "https://" + feedURL
}

fp := gofeed.NewParser()
feed, err := fp.ParseURL(feedURL)
if err != nil {
Expand Down

0 comments on commit 223613f

Please sign in to comment.