yesod-newsfeed-1.7.0.0: Helper functions and data types for producing News feeds.

Safe Haskell | None
Language | Haskell98

Yesod.RssFeed

Synopsis

- rssFeed :: MonadHandler m => Feed (Route (HandlerSite m)) -> m RepRss
- rssFeedText :: MonadHandler m => Feed Text -> m RepRss
- rssLink :: MonadWidget m => Route (HandlerSite m) -> Text -> m ()
- newtype RepRss = RepRss Content
- data Feed url = Feed {
  - feedTitle :: Text
  - feedLinkSelf :: url
  - feedLinkHome :: url
  - feedAuthor :: Text
  - feedDescription :: Html
  - feedLanguage :: Text
  - feedUpdated :: UTCTime
  - feedLogo :: Maybe (url, Text)
  - feedEntries :: [FeedEntry url]
  }
- data FeedEntry url = FeedEntry {
  - feedEntryLink :: url
  - feedEntryUpdated :: UTCTime
  - feedEntryTitle :: Text
  - feedEntryContent :: Html
  - feedEntryEnclosure :: Maybe (EntryEnclosure url)
  - feedEntryCategories :: [EntryCategory]
  }
- data EntryEnclosure url = EntryEnclosure {
  - enclosedUrl :: url
  - enclosedSize :: Int
  - enclosedMimeType :: Text
  }
- data EntryCategory = EntryCategory {
  - categoryDomain :: Maybe Text
  - categoryLabel :: Maybe Text
  - categoryValue :: Text
  }

# Documentation

rssFeed :: MonadHandler m => Feed (Route (HandlerSite m)) -> m RepRss Source #

Generate the feed

rssFeedText :: MonadHandler m => Feed Text -> m RepRss Source #

Same as ``rssFeed`` but for `'Feed Text'`. Useful for cases where you are generating a feed of external links.

rssLink Source #

Arguments

:: MonadWidget m |
=> Route (HandlerSite m) |
-> Text | title
-> m () |

Generates a link tag in the head of a widget.

newtype RepRss Source #

Constructors

RepRss Content |

#### Instances

Instances details

HasContentType RepRss Source # |
Instance details Defined in Yesod.RssFeed Methods getContentType :: Monad m => m RepRss -> ContentType Source #
ToContent RepRss Source # |
Instance details Defined in Yesod.RssFeed Methods toContent :: RepRss -> Content Source #
ToTypedContent RepRss Source # |
Instance details Defined in Yesod.RssFeed Methods toTypedContent :: RepRss -> TypedContent Source #

data Feed url Source #

The overall feed

Constructors

Feed |

Fields

- feedTitle :: Text
- feedLinkSelf :: url
- feedLinkHome :: url
- feedAuthor :: Text
- feedDescription :: Html

  note: currently only used for Rss

- feedLanguage :: Text

  note: currently only used for Rss, possible values: http://www.rssboard.org/rss-language-codes

- feedUpdated :: UTCTime
- feedLogo :: Maybe (url, Text)
- feedEntries :: [FeedEntry url]

data FeedEntry url Source #

Each feed entry

Constructors

FeedEntry |

Fields

- feedEntryLink :: url
- feedEntryUpdated :: UTCTime
- feedEntryTitle :: Text
- feedEntryContent :: Html
- feedEntryEnclosure :: Maybe (EntryEnclosure url)

  Allows enclosed data: RSS <enclosure> or Atom <link rel=enclosure>

  Since: 1.5

- feedEntryCategories :: [EntryCategory]

  Allows categories data: RSS <category> or Atom <link term=category>

  Since: 1.7

data EntryEnclosure url Source #

RSS and Atom allow for linked content to be enclosed in a feed entry. This represents the enclosed content.

Atom feeds ignore `enclosedSize` and `enclosedMimeType`.

Since: 1.6

Constructors

EntryEnclosure |

Fields

- enclosedUrl :: url
- enclosedSize :: Int

  Specified in bytes

- enclosedMimeType :: Text

data EntryCategory Source #

RSS 2.0 and Atom allow category in a feed entry.

- RSS category
- Atom category

RSS feeds ignore `categoryLabel`

Since: 1.7

Constructors

EntryCategory |

Fields

- categoryDomain :: Maybe Text

  category identifier

- categoryLabel :: Maybe Text

  Human-readable label Atom only

- categoryValue :: Text

  identified categorization scheme via URI