Add last built to RSS.

This commit is contained in:
Dillon Kearns 2020-01-05 21:01:40 -08:00
parent 4c4d26e320
commit 1729723b7d
2 changed files with 7 additions and 8 deletions

View File

@ -12,6 +12,7 @@
"billstclair/elm-xml-eeue56": "1.0.1",
"dillonkearns/elm-markdown": "1.1.3",
"dillonkearns/elm-oembed": "1.0.0",
"dmy/elm-imf-date-time": "1.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.2",
"elm/html": "1.0.0",
@ -43,7 +44,10 @@
"elm/regex": "1.0.0",
"elm/virtual-dom": "1.0.2",
"fredcy/elm-parseint": "2.0.1",
"mgold/elm-nonempty-list": "4.0.2"
"justinmimbs/time-extra": "1.1.0",
"lazamar/dict-parser": "1.0.2",
"mgold/elm-nonempty-list": "4.0.2",
"ryannhg/date-format": "2.3.0"
}
},
"test-dependencies": {

View File

@ -2,6 +2,7 @@ module RssFeed exposing (Item, generate)
import Date exposing (Date)
import Dict
import Imf.DateTime
import Time
import Xml
import Xml.Encode exposing (..)
@ -41,12 +42,6 @@ generate :
}
-> Xml.Value
generate feed =
let
lastBuildTimeString =
-- TODO
--feed.lastBuildTime
""
in
object
[ ( "rss"
, Dict.fromList
@ -62,7 +57,7 @@ generate feed =
([ keyValue "title" feed.title
, keyValue "description" feed.description
, keyValue "link" feed.url
, keyValue "lastBuildDate" lastBuildTimeString
, keyValue "lastBuildDate" <| Imf.DateTime.fromPosix Time.utc feed.lastBuildTime
]
++ List.map itemXml feed.items
++ ([ feed.generator |> Maybe.map generatorXml