feed/feed.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package feed import ( "log" "sort" "github.com/SlyMarbo/rss" ) var lovelyFeedList = []string{ "http://antirez.com/rss", "https://100r.co/links/rss.xml", "https://andrewkelley.me/rss.xml", "https://begriffs.com/atom.xml", "https://blog.jse.li/index.xml", "https://blog.tildes.net/all.atom.xml", "https://coderanger.net/atom.xml", "https://cyberia.club/blog/blog.xml", "https://davebucklin.com/feed.xml", "https://drewdevault.com/feed.xml", "https://emersion.fr/blog/rss.xml", "https://emilydamstra.com/feed", "https://facklambda.dev/atom.xml", "https://frame.work/blog.rss", "https://georgerrmartin.com/notablog/feed", "https://go.dev/blog/feed.atom", "https://herman.bearblog.dev/feed/", "https://kattraxler.github.io/feed.xml", "https://linuxwit.ch/feed.xml", "https://matrix.org/blog/feed", "https://rodarmor.com/feed/feed.xml", "https://sanine.net/rss.xml", "https://sequentialread.com/rss", "https://sourcehut.org/blog/index.xml", "https://spencerkrum.com/index.xml", "https://staffeng.com/rss", "https://thephd.dev/feed.xml", "https://tilde.team/~kiedtl/atom.xml", "https://words.filippo.io/rss/", "https://www.bitquabit.com/index.xml", "https://www.namecoin.org/feed.rss", "https://www.ryanprior.com/posts/index.xml", } func GetAllFeeds() []rss.Feed { var feeds []rss.Feed for _, f := range lovelyFeedList { feed, err := rss.Fetch(f) if err != nil { log.Println(err) continue } feeds = append(feeds, *feed) } return feeds } func SortItems(f []rss.Feed) []rss.Item { var posts []rss.Item for _, f := range f { for _, i := range f.Items { posts = append(posts, *i) } } // magick slice sorter by date sort.Slice(posts, func(i, j int) bool { return posts[i].Date.After(posts[j].Date) }) return posts }