Missing handlers but there we goddamn GO

Former-commit-id: 2505146a54acaf18eadfdebf1dd2720889aef795
This commit is contained in:
bel
2019-06-22 16:23:27 -06:00
parent 093d468f87
commit 35b3ff2c2d
24 changed files with 216 additions and 37 deletions

View File

@@ -1,8 +1,10 @@
package rss
import (
"fmt"
"io"
"local/rssmon3/config"
"sort"
"github.com/gorilla/feeds"
)
@@ -29,6 +31,7 @@ func TaggedFeeds(tag string) ([]*Feed, error) {
}
func WriteFeed(w io.Writer, tag string, items []*Item) error {
sort.Sort(Items(items))
feed := &feeds.Feed{
Title: tag,
Link: &feeds.Link{},
@@ -47,6 +50,6 @@ func WriteFeed(w io.Writer, tag string, items []*Item) error {
if err != nil {
return err
}
w.Write([]byte(s))
fmt.Fprintf(w, "%s\n", s)
return nil
}