Copyright | (c) Galois Inc. 2008 (c) Sigbjorn Finne 2009- |
---|---|
License | BSD3 |
Maintainer | Sigbjorn Finne <sof@forkIO.com> |
Stability | provisional |
Safe Haskell | Safe |
Language | Haskell98 |
Description: Module for an abstraction layer between different kinds of feeds.
- data FeedKind
- newFeed :: FeedKind -> Feed
- feedFromRSS :: RSS -> Feed
- feedFromAtom :: Feed -> Feed
- feedFromRDF :: Feed -> Feed
- feedFromXML :: Element -> Feed
- getFeedKind :: Feed -> FeedKind
- type FeedSetter a = a -> Feed -> Feed
- addItem :: Item -> Feed -> Feed
- withFeedTitle :: FeedSetter Text
- withFeedHome :: FeedSetter URLString
- withFeedHTML :: FeedSetter URLString
- withFeedDescription :: FeedSetter Text
- withFeedPubDate :: FeedSetter Text
- withFeedLastUpdate :: FeedSetter DateString
- withFeedDate :: FeedSetter DateString
- withFeedLogoLink :: URLString -> FeedSetter URLString
- withFeedLanguage :: FeedSetter Text
- withFeedCategories :: FeedSetter [(Text, Maybe Text)]
- withFeedGenerator :: FeedSetter (Text, Maybe URLString)
- withFeedItems :: FeedSetter [Item]
- newItem :: FeedKind -> Item
- getItemKind :: Item -> FeedKind
- atomEntryToItem :: Entry -> Item
- rssItemToItem :: RSSItem -> Item
- rdfItemToItem :: Item -> Item
- type ItemSetter a = a -> Item -> Item
- withItemTitle :: ItemSetter Text
- withItemLink :: ItemSetter URLString
- withItemPubDate :: ItemSetter DateString
- withItemDate :: ItemSetter DateString
- withItemAuthor :: ItemSetter Text
- withItemCommentLink :: ItemSetter Text
- withItemEnclosure :: Text -> Maybe Text -> ItemSetter (Maybe Integer)
- withItemFeedLink :: Text -> ItemSetter Text
- withItemId :: Bool -> ItemSetter Text
- withItemCategories :: ItemSetter [(Text, Maybe Text)]
- withItemDescription :: ItemSetter Text
- withItemRights :: ItemSetter Text
Documentation
The kinds of feed documents supported.
newFeed :: FeedKind -> Feed Source #
Construct an empty feed document, intending to output it in
the fk
feed format.
feedFromRSS :: RSS -> Feed Source #
feedFromAtom :: Feed -> Feed Source #
feedFromRDF :: Feed -> Feed Source #
feedFromXML :: Element -> Feed Source #
getFeedKind :: Feed -> FeedKind Source #
type FeedSetter a = a -> Feed -> Feed Source #
withFeedHTML :: FeedSetter URLString Source #
withFeedHTML
sets the URL where an HTML version of the
feed is published.
withFeedDescription :: FeedSetter Text Source #
withFeedHTML
sets the URL where an HTML version of the
feed is published.
withFeedDate :: FeedSetter DateString Source #
'withFeedDate dt' is the composition of withFeedPubDate
and withFeedLastUpdate
, setting both publication date and
last update date to dt
. Notice that RSS2.0 is the only format
supporting both pub and last-update.
withFeedCategories :: FeedSetter [(Text, Maybe Text)] Source #
withFeedItems :: FeedSetter [Item] Source #
getItemKind :: Item -> FeedKind Source #
atomEntryToItem :: Entry -> Item Source #
rssItemToItem :: RSSItem -> Item Source #
rdfItemToItem :: Item -> Item Source #
type ItemSetter a = a -> Item -> Item Source #
withItemTitle :: ItemSetter Text Source #
'withItemTitle myTitle' associates a new title, myTitle
,
with a feed item.
withItemLink :: ItemSetter URLString Source #
'withItemTitle myLink' associates a new URL, myLink
,
with a feed item.
withItemPubDate :: ItemSetter DateString Source #
'withItemPubDate dt' associates the creation/ publication date dt
with a feed item.
withItemDate :: ItemSetter DateString Source #
withItemDate
is a synonym for withItemPubDate
.
withItemAuthor :: ItemSetter Text Source #
'withItemAuthor auStr' associates new author info with a feed item.
withItemCommentLink :: ItemSetter Text Source #
'withItemCommentLink url' sets the URL reference to the comment page to url
.
withItemEnclosure :: Text -> Maybe Text -> ItemSetter (Maybe Integer) Source #
'withItemEnclosure url mbTy len' sets the URL reference to the comment page to url
.
withItemFeedLink :: Text -> ItemSetter Text Source #
'withItemFeedLink name myFeed' associates the parent feed URL myFeed
with a feed item. It is labelled as name
.
withItemId :: Bool -> ItemSetter Text Source #
'withItemId isURL id' associates new unique identifier with a feed item.
If isURL
is True
, then the id is assumed to point to a valid web resource.
withItemCategories :: ItemSetter [(Text, Maybe Text)] Source #
withItemDescription :: ItemSetter Text Source #
'withItemDescription desc' associates a new descriptive string (aka summary) with a feed item.
withItemRights :: ItemSetter Text Source #
'withItemRights rightStr' associates the rights information rightStr
with a feed item.