feed-0.3.12.0: Interfacing with RSS (v 0.9x, 2.x, 1.0) + Atom feeds.

Copyright | (c) Galois Inc. 2008 (c) Sigbjorn Finne 2009-
License | BSD3
Maintainer | Sigbjorn Finne <sof@forkIO.com>
Stability | provisional
Safe Haskell | Safe
Language | Haskell98

Text.RSS.Syntax

Description

The basic syntax for putting together feeds.

For instance, to create a feed with a single item item: (nullRSS "rss title" "link") {rssChannel=(nullChannel "channel title" "link") {rssItems=[(nullItem "item title")]}}

Synopsis

- data RSS = RSS {
  - rssVersion :: String
  - rssAttrs :: [Attr]
  - rssChannel :: RSSChannel
  - rssOther :: [Element]
  }
- type URLString = String
- type DateString = String
- data RSSChannel = RSSChannel {
  - rssTitle :: String
  - rssLink :: URLString
  - rssDescription :: String
  - rssItems :: [RSSItem]
  - rssLanguage :: Maybe String
  - rssCopyright :: Maybe String
  - rssEditor :: Maybe String
  - rssWebMaster :: Maybe String
  - rssPubDate :: Maybe DateString
  - rssLastUpdate :: Maybe DateString
  - rssCategories :: [RSSCategory]
  - rssGenerator :: Maybe String
  - rssDocs :: Maybe URLString
  - rssCloud :: Maybe RSSCloud
  - rssTTL :: Maybe Integer
  - rssImage :: Maybe RSSImage
  - rssRating :: Maybe String
  - rssTextInput :: Maybe RSSTextInput
  - rssSkipHours :: Maybe [Integer]
  - rssSkipDays :: Maybe [String]
  - rssChannelOther :: [Element]
  }
- data RSSItem = RSSItem {
  - rssItemTitle :: Maybe String
  - rssItemLink :: Maybe URLString
  - rssItemDescription :: Maybe String
  - rssItemAuthor :: Maybe String
  - rssItemCategories :: [RSSCategory]
  - rssItemComments :: Maybe URLString
  - rssItemEnclosure :: Maybe RSSEnclosure
  - rssItemGuid :: Maybe RSSGuid
  - rssItemPubDate :: Maybe DateString
  - rssItemSource :: Maybe RSSSource
  - rssItemAttrs :: [Attr]
  - rssItemOther :: [Element]
  }
- data RSSSource = RSSSource {
  - rssSourceURL :: URLString
  - rssSourceAttrs :: [Attr]
  - rssSourceTitle :: String
  }
- data RSSEnclosure = RSSEnclosure {
  - rssEnclosureURL :: URLString
  - rssEnclosureLength :: Maybe Integer
  - rssEnclosureType :: String
  - rssEnclosureAttrs :: [Attr]
  }
- data RSSCategory = RSSCategory {
  - rssCategoryDomain :: Maybe String
  - rssCategoryAttrs :: [Attr]
  - rssCategoryValue :: String
  }
- data RSSGuid = RSSGuid {
  - rssGuidPermanentURL :: Maybe Bool
  - rssGuidAttrs :: [Attr]
  - rssGuidValue :: String
  }
- data RSSImage = RSSImage {
  - rssImageURL :: URLString
  - rssImageTitle :: String
  - rssImageLink :: URLString
  - rssImageWidth :: Maybe Integer
  - rssImageHeight :: Maybe Integer
  - rssImageDesc :: Maybe String
  - rssImageOther :: [Element]
  }
- data RSSCloud = RSSCloud {
  - rssCloudDomain :: Maybe String
  - rssCloudPort :: Maybe String
  - rssCloudPath :: Maybe String
  - rssCloudRegisterProcedure :: Maybe String
  - rssCloudProtocol :: Maybe String
  - rssCloudAttrs :: [Attr]
  }
- data RSSTextInput = RSSTextInput {
  - rssTextInputTitle :: String
  - rssTextInputDesc :: String
  - rssTextInputName :: String
  - rssTextInputLink :: URLString
  - rssTextInputAttrs :: [Attr]
  - rssTextInputOther :: [Element]
  }
- nullRSS :: String -> URLString -> RSS
- nullChannel :: String -> URLString -> RSSChannel
- nullItem :: String -> RSSItem
- nullSource :: URLString -> String -> RSSSource
- nullEnclosure :: URLString -> Maybe Integer -> String -> RSSEnclosure
- newCategory :: String -> RSSCategory
- nullGuid :: String -> RSSGuid
- nullPermaGuid :: String -> RSSGuid
- nullImage :: URLString -> String -> URLString -> RSSImage
- nullCloud :: RSSCloud
- nullTextInput :: String -> String -> URLString -> RSSTextInput

# Documentation

data RSS Source #

Constructors

RSS |

Fields

- rssVersion :: String
- rssAttrs :: [Attr]
- rssChannel :: RSSChannel
- rssOther :: [Element]

Instances

Show RSS Source # |
Methods showsPrec :: Int -> RSS -> ShowS # show :: RSS -> String # showList :: [RSS] -> ShowS #

type URLString = String Source #

type DateString = String Source #

RFC 822 conforming.

data RSSChannel Source #

Constructors

RSSChannel |

Fields

- rssTitle :: String
- rssLink :: URLString
- rssDescription :: String
- rssItems :: [RSSItem]
- rssLanguage :: Maybe String
- rssCopyright :: Maybe String
- rssEditor :: Maybe String
- rssWebMaster :: Maybe String
- rssPubDate :: Maybe DateString

  rfc 822 conforming.

- rssLastUpdate :: Maybe DateString

  rfc 822 conforming.

- rssCategories :: [RSSCategory]
- rssGenerator :: Maybe String
- rssDocs :: Maybe URLString
- rssCloud :: Maybe RSSCloud
- rssTTL :: Maybe Integer
- rssImage :: Maybe RSSImage
- rssRating :: Maybe String
- rssTextInput :: Maybe RSSTextInput
- rssSkipHours :: Maybe [Integer]
- rssSkipDays :: Maybe [String]
- rssChannelOther :: [Element]

Instances

Show RSSChannel Source # |
Methods showsPrec :: Int -> RSSChannel -> ShowS # show :: RSSChannel -> String # showList :: [RSSChannel] -> ShowS #

data RSSItem Source #

Constructors

RSSItem |

Fields

- rssItemTitle :: Maybe String
- rssItemLink :: Maybe URLString
- rssItemDescription :: Maybe String

  if not present, the title is. (per spec, at least.)

- rssItemAuthor :: Maybe String
- rssItemCategories :: [RSSCategory]
- rssItemComments :: Maybe URLString
- rssItemEnclosure :: Maybe RSSEnclosure
- rssItemGuid :: Maybe RSSGuid
- rssItemPubDate :: Maybe DateString
- rssItemSource :: Maybe RSSSource
- rssItemAttrs :: [Attr]
- rssItemOther :: [Element]

Instances

Show RSSItem Source # |
Methods showsPrec :: Int -> RSSItem -> ShowS # show :: RSSItem -> String # showList :: [RSSItem] -> ShowS #

data RSSSource Source #

Constructors

RSSSource |

Fields

- rssSourceURL :: URLString
- rssSourceAttrs :: [Attr]
- rssSourceTitle :: String

Instances

Show RSSSource Source # |
Methods showsPrec :: Int -> RSSSource -> ShowS # show :: RSSSource -> String # showList :: [RSSSource] -> ShowS #

data RSSEnclosure Source #

Constructors

RSSEnclosure |

Fields

- rssEnclosureURL :: URLString
- rssEnclosureLength :: Maybe Integer
- rssEnclosureType :: String
- rssEnclosureAttrs :: [Attr]

Instances

Show RSSEnclosure Source # |
Methods showsPrec :: Int -> RSSEnclosure -> ShowS # show :: RSSEnclosure -> String # showList :: [RSSEnclosure] -> ShowS #

data RSSCategory Source #

Constructors

RSSCategory |

Fields

- rssCategoryDomain :: Maybe String
- rssCategoryAttrs :: [Attr]
- rssCategoryValue :: String

Instances

Show RSSCategory Source # |
Methods showsPrec :: Int -> RSSCategory -> ShowS # show :: RSSCategory -> String # showList :: [RSSCategory] -> ShowS #

data RSSGuid Source #

Constructors

RSSGuid |

Fields

- rssGuidPermanentURL :: Maybe Bool
- rssGuidAttrs :: [Attr]
- rssGuidValue :: String

Instances

Show RSSGuid Source # |
Methods showsPrec :: Int -> RSSGuid -> ShowS # show :: RSSGuid -> String # showList :: [RSSGuid] -> ShowS #

data RSSImage Source #

Constructors

RSSImage |

Fields

- rssImageURL :: URLString
- rssImageTitle :: String
- rssImageLink :: URLString
- rssImageWidth :: Maybe Integer
- rssImageHeight :: Maybe Integer
- rssImageDesc :: Maybe String
- rssImageOther :: [Element]

Instances

Show RSSImage Source # |
Methods showsPrec :: Int -> RSSImage -> ShowS # show :: RSSImage -> String # showList :: [RSSImage] -> ShowS #

data RSSCloud Source #

Constructors

RSSCloud |

Fields

- rssCloudDomain :: Maybe String
- rssCloudPort :: Maybe String
- rssCloudPath :: Maybe String
- rssCloudRegisterProcedure :: Maybe String
- rssCloudProtocol :: Maybe String
- rssCloudAttrs :: [Attr]

Instances

Show RSSCloud Source # |
Methods showsPrec :: Int -> RSSCloud -> ShowS # show :: RSSCloud -> String # showList :: [RSSCloud] -> ShowS #

data RSSTextInput Source #

Constructors

RSSTextInput |

Fields

- rssTextInputTitle :: String
- rssTextInputDesc :: String
- rssTextInputName :: String
- rssTextInputLink :: URLString
- rssTextInputAttrs :: [Attr]
- rssTextInputOther :: [Element]

Instances

Show RSSTextInput Source # |
Methods showsPrec :: Int -> RSSTextInput -> ShowS # show :: RSSTextInput -> String # showList :: [RSSTextInput] -> ShowS #

nullRSS Source #

Arguments

:: String | channel title
-> URLString | channel link
-> RSS |

nullChannel Source #

Arguments

:: String | rssTitle
-> URLString | rssLink
-> RSSChannel |

nullItem Source #

Arguments

:: String | title
-> RSSItem |

nullSource Source #

Arguments

:: URLString | source URL
-> String | title
-> RSSSource |

nullEnclosure Source #

Arguments

:: URLString | enclosure URL
-> Maybe Integer | enclosure length
-> String | enclosure type
-> RSSEnclosure |

newCategory Source #

Arguments

:: String | category Value
-> RSSCategory |

nullGuid Source #

Arguments

:: String | guid value
-> RSSGuid |

nullPermaGuid Source #

Arguments

:: String | guid value
-> RSSGuid |

nullImage Source #

Arguments

:: URLString | imageURL
-> String | imageTitle
-> URLString | imageLink
-> RSSImage |

nullCloud :: RSSCloud Source #

nullTextInput Source #

Arguments

:: String | inputTitle
-> String | inputName
-> URLString | inputLink
-> RSSTextInput |