| 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 | Bas van Dijk <v.dijk.bas@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell98 |
Text.RSS
Description
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
UTCTimefromtimeinstead ofCalendarTimefromold-time. - Add our own
Weekdaytype instead of using theDaytype fromold-time.
- 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
Constructors
| RSS Title Link Description [ChannelElem] [Item] |
data ChannelElem Source #
Constructors
Instances
type Description = String Source #
A day of the week.
type CloudProcedure = String Source #