diff options
author | Vincent Ambo <tazjin@google.com> | 2020-02-09T00·43+0000 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-02-09T00·43+0000 |
commit | 05ab6825b3451687fbaf6f8c987e94e616b6d4ff (patch) | |
tree | d1e8ad284bc89f6f6eb6156121151465fa3e3672 /web/tazblog/src/RSS.hs | |
parent | 9fc9b58301b3e0c538ffb8b7e4e7a7dab9fbc243 (diff) |
chore(web): Delete //web/tazblog r/499
Deleting this code feels strange. This project has been around for a decade, and despite occasionally needing a bunch of tweaks it had aged well and worked fine for a very long time. I've reached a strange point where I don't really feel like using Haskell anymore, and every interaction with this project in recent years has been fighting dependency management tooling for Haskell, or dealing with strange build problems. The simple fact is that the service never really did anything other than render Markdown dynamically, and at this point I can do that much better with //tools/cheddar instead. So, tazblog-hs, it's time to say goodbye. Rest in peace!
Diffstat (limited to 'web/tazblog/src/RSS.hs')
-rw-r--r-- | web/tazblog/src/RSS.hs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/web/tazblog/src/RSS.hs b/web/tazblog/src/RSS.hs deleted file mode 100644 index 913aa9a4081b..000000000000 --- a/web/tazblog/src/RSS.hs +++ /dev/null @@ -1,48 +0,0 @@ -{-# LANGUAGE RecordWildCards #-} - -module RSS - ( renderFeed - ) -where - -import BlogStore -import Data.Maybe (fromJust) -import qualified Data.Text as T -import Data.Time (UTCTime (..), getCurrentTime, secondsToDiffTime) -import Network.URI (URI, parseURI) -import Text.RSS - -createChannel :: UTCTime -> [ChannelElem] -createChannel now = - [ Language "en", - Copyright "Vincent Ambo", - WebMaster "mail@tazj.in", - ChannelPubDate now - ] - -createRSS :: UTCTime -> [Item] -> RSS -createRSS t = - let link = fromJust $ parseURI "https://tazj.in" - in RSS "tazjin's blog" link "tazjin's blog feed" (createChannel t) - -createItem :: Entry -> Item -createItem Entry {..} = - [ Title "tazjin's blog", - Link $ entryLink entryId, - Description $ T.unpack text, - PubDate $ UTCTime edate $ secondsToDiffTime 0 - ] - -entryLink :: EntryId -> URI -entryLink i = - let url = "http://tazj.in/" ++ "/" ++ show i - in fromJust $ parseURI url - -createItems :: [Entry] -> [Item] -createItems = map createItem - -createFeed :: [Entry] -> IO RSS -createFeed e = getCurrentTime >>= (\t -> return $ createRSS t $ createItems e) - -renderFeed :: [Entry] -> IO String -renderFeed e = fmap (showXML . rssToXML) (createFeed e) |