2021-11-11 21:15:17 +02:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Main where
|
|
|
|
|
|
|
|
import FeedMonad
|
|
|
|
import Data.Category
|
2021-11-11 23:17:57 +02:00
|
|
|
import Data.URL (URL(..), _URL)
|
2021-11-11 23:00:50 +02:00
|
|
|
import Database (FeedId(..))
|
2021-11-11 23:17:57 +02:00
|
|
|
import Middleware
|
|
|
|
import qualified Data.Set as S
|
|
|
|
import Data.Entry
|
|
|
|
import Data.List.Lens (prefixed)
|
|
|
|
import Control.Lens
|
2021-11-11 22:08:46 +02:00
|
|
|
|
2021-11-11 23:00:50 +02:00
|
|
|
myFeeds :: [ Category FeedId ]
|
2021-11-11 22:08:46 +02:00
|
|
|
myFeeds =
|
2021-11-12 17:25:47 +02:00
|
|
|
[ Category "Code"
|
2021-11-11 23:00:50 +02:00
|
|
|
[Leaf (FeedId (URL "https://github.com/feediron/feediron-recipes/commits/master.atom"))]
|
2021-11-12 17:25:47 +02:00
|
|
|
, Category "News"
|
|
|
|
[ Category "Yle"
|
|
|
|
[ Leaf (FeedId (URL "https://feeds.yle.fi/uutiset/v1/majorHeadlines/YLE_UUTISET.rss"))
|
|
|
|
, Leaf (FeedId (URL "https://feeds.yle.fi/uutiset/v1/recent.rss?publisherIds=YLE_UUTISET&concepts=18-147345"))
|
|
|
|
]
|
|
|
|
]
|
|
|
|
, Category "Programming"
|
|
|
|
[ Leaf (FeedId (URL "https://reddit.com/r/haskell.rss"))
|
|
|
|
, Leaf (FeedId (URL "https://discourse.dhall-lang.org/latest.rss"))
|
|
|
|
, Leaf (FeedId (URL "https://www.haskellforall.com/feeds/posts/default"))
|
|
|
|
]
|
2021-11-11 22:08:46 +02:00
|
|
|
]
|
2021-11-11 21:15:17 +02:00
|
|
|
|
2021-11-11 23:17:57 +02:00
|
|
|
myFilters :: Middleware
|
|
|
|
myFilters =
|
|
|
|
modifyScore (has (tags . ix (Tag "github"))) (+10) .
|
|
|
|
modifyScore (has (tags . ix (Tag "haskell"))) (+20) .
|
|
|
|
modifyTags (has (url . _URL . prefixed "tag:github.com")) (S.insert (Tag "github"))
|
|
|
|
|
|
|
|
|
2021-11-11 21:15:17 +02:00
|
|
|
main :: IO ()
|
|
|
|
main = do
|
2021-11-11 23:17:57 +02:00
|
|
|
defaultMain defaultConfig{feeds = myFeeds, filters = myFilters }
|