diff --git a/internal/goeland/fetch/feed.go b/internal/goeland/fetch/feed.go index b6789c7..febe0a4 100644 --- a/internal/goeland/fetch/feed.go +++ b/internal/goeland/fetch/feed.go @@ -88,6 +88,7 @@ func fetchFeed(source *goeland.Source, feedLocation string, isFile bool) error { source.Entries = append(source.Entries, entry) } source.Title = feed.Title + source.URL = feed.Link return nil } diff --git a/internal/goeland/fetch/imgur.go b/internal/goeland/fetch/imgur.go index ca4c6d0..f0241b2 100644 --- a/internal/goeland/fetch/imgur.go +++ b/internal/goeland/fetch/imgur.go @@ -2,6 +2,7 @@ package fetch import ( "encoding/json" + "fmt" "io/ioutil" "net/http" "time" @@ -81,6 +82,7 @@ func fetchImgurTag(source *goeland.Source, tag string, sort string) error { entry.URL = item.Link source.Entries = append(source.Entries, entry) } - source.Title = "Imgur pictures for tag #" + tag + source.Title = fmt.Sprintf("Imgur pictures for tag #%s", tag) + source.URL = fmt.Sprintf("https://imgur.com/t/%s", tag) return nil } diff --git a/internal/goeland/filters/filter.go b/internal/goeland/filters/filter.go index 10ec32c..bd3c3dc 100644 --- a/internal/goeland/filters/filter.go +++ b/internal/goeland/filters/filter.go @@ -55,6 +55,7 @@ var filters = map[string]filter{ "untrack": {"Removes feedburner pixel tracking", filterUntrack}, "reddit": {"Better formatting for reddit rss", filterReddit}, "sanitize": {"Sanitize the content of entries (to be used in case of --unsafe-no-sanitize-filter flag)", filterSanitize}, + "toc": {"Create a table of content entry for all the entries", filterToc}, } func GetFiltersHelp() string { @@ -244,6 +245,31 @@ func filterEmbedImage(source *goeland.Source, params *filterParams) { } } +func filterToc(source *goeland.Source, params *filterParams) { + toc := goeland.Entry{} + args := params.args + if len(args) > 0 && strings.ToLower(args[0]) == "nameastitle" { + toc.Title = fmt.Sprintf(`%s`, source.URL, source.Title) + } else { + toc.Title = fmt.Sprintf("Table of Content for %s", source.Title) + } + content := "