Copyright | Copyright 2004 Jeremy Shaw http://www.n-heptane.com/ Copyright 2004-2006 Bjorn Bringert (bjorn@bringert.net) |
---|---|
License | This code is released to the public domain and comes with no warranty. |
Maintainer | Andreas Abel |
Stability | stable |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
A libary for generating RSS 2.0 feeds.
Original module by Jeremy Shaw.
Changes by Bjorn Bringert:
- showXml just converts the RSS to a String, does not print it.
- Added XML escaping.
- Use RFC 2822 format for dates.
- Added all elements from RSS 2.0.1-rv-6, http://www.rssboard.org/rss-2-0-1-rv-6
- Use HaXml.Verbatim instead of HaXml.Pretty, since HaXml.Pretty seems to introduce spaces around entities.
- Removed the use of content:encoded, since the description tag is the recommented way to include HTML content in RSS 2.0.
Changes by Bas van Dijk:
- Use
UTCTime
fromtime
instead ofCalendarTime
fromold-time
. - Add our own
Weekday
type instead of using theDay
type fromold-time
.
Synopsis
- data RSS = RSS Title Link Description [ChannelElem] [Item]
- type Item = [ItemElem]
- data ChannelElem
- = Language String
- | Copyright String
- | ManagingEditor Email
- | WebMaster Email
- | ChannelPubDate UTCTime
- | LastBuildDate UTCTime
- | ChannelCategory (Maybe Domain) String
- | Generator String
- | Cloud CloudHost CloudPort CloudPath CloudProcedure CloudProtocol
- | TTL Minutes
- | Image URI Title Link (Maybe Width) (Maybe Height) (Maybe Description)
- | Rating String
- | TextInput Title Description InputName Link
- | SkipHours [Hour]
- | SkipDays [Weekday]
- data ItemElem
- type Title = String
- type Link = URI
- type Description = String
- type Width = Int
- type Height = Int
- type Email = String
- type Domain = String
- type MIME_Type = String
- type InputName = String
- data Weekday
- type Hour = Int
- type Minutes = Int
- type CloudHost = String
- type CloudPort = Int
- type CloudPath = String
- type CloudProcedure = String
- data CloudProtocol
- rssToXML :: RSS -> CFilter ()
- showXML :: CFilter () -> String
Documentation
data ChannelElem Source #
Instances
Show ChannelElem Source # | |
Defined in Text.RSS showsPrec :: Int -> ChannelElem -> ShowS # show :: ChannelElem -> String # showList :: [ChannelElem] -> ShowS # |
type Description = String Source #
A day of the week.
Instances
Bounded Weekday Source # | |
Enum Weekday Source # | |
Ix Weekday Source # | |
Read Weekday Source # | |
Show Weekday Source # | |
Eq Weekday Source # | |
Ord Weekday Source # | |
type CloudProcedure = String Source #
data CloudProtocol Source #
Instances
Show CloudProtocol Source # | |
Defined in Text.RSS showsPrec :: Int -> CloudProtocol -> ShowS # show :: CloudProtocol -> String # showList :: [CloudProtocol] -> ShowS # |