| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Follow
Description
Read the README
file for a description of Follow application.
Importing this module makes all application scope components available. In addition, you probably will need to import individual fetchers, middlewares and digesters.
Synopsis
- data Recipe m = Recipe {
- rSubject :: Subject
- rSteps :: [Step m]
- rMiddlewares :: [Middleware]
- data Subject = Subject {}
- data Entry = Entry {}
- type Fetched m = m [Entry]
- data Directory = Directory {}
- type Step m = (Fetched m, [Middleware])
- type Middleware = Directory -> Directory
- type Digester a = Directory -> a
- directoryFromRecipe :: MonadThrow m => Recipe m -> m Directory
- directoryFromFetched :: MonadThrow m => m [Entry] -> Subject -> m Directory
- applyMiddlewares :: [Middleware] -> Directory -> Directory
- applySteps :: MonadThrow m => Directory -> [Step m] -> m Directory
- emptyDirectory :: Subject -> Directory
- mergeEntries :: Directory -> [Entry] -> Directory
Documentation
A recipe is a specification of a complete strategy to create the content to follow a subject.
Constructors
| Recipe | |
Fields
| |
Instances
| (MonadThrow m, MonadHttp m) => FromJSON (Recipe m) # | subject: # See |
Subject being followed. The whole idea of Follow is being able
to build strategies to gather URIs for the content published about any
subject.
Constructors
| Subject | |
An item of content that has been published somewhere.
Constructors
| Entry | |
Instances
| Eq Entry Source # | |
| Show Entry Source # | |
| FromJSON ComparisonFunction # | type: by_field
options:
field: title
|
Defined in Follow.Parser Methods parseJSON :: Value -> Parser ComparisonFunction # parseJSONList :: Value -> Parser [ComparisonFunction] # | |
| FromJSON Predicate # | type: equal
options:
field: title
value: Title
or type: less
options:
field: publish_date
value: 2018-08-08 00:00:00
or type: greater
options:
field: publish_date
value: 2018-08-08 00:00:00
or type: infix
options:
field: title
value: something
or type: prefix
options:
field: title
value: The
or type: suffix
options:
field: title
value: end
or type: not
options:
operator: # See or type: and
options:
operator1: # See or type: or
options:
operator1: # See |
| (MonadThrow m, MonadHttp m) => FromJSON (Fetched m) # | type: feed
options:
url: http://someurl.com
or type: webscraping
options:
url: http://someurl.com
selector: # See |
Gathering of Item published for some Subject.
type Step m = (Fetched m, [Middleware]) Source #
A list of middlewares to be applied to some fetched entries.
type Middleware = Directory -> Directory Source #
Middleware does something to a directory.
type Digester a = Directory -> a Source #
Digesters are strategies to transform a directory into something to be consumed by an end user.
directoryFromRecipe :: MonadThrow m => Recipe m -> m Directory Source #
Builds a directory from the specification stored in a recipe
directoryFromFetched :: MonadThrow m => m [Entry] -> Subject -> m Directory Source #
Helper to build a directory from a subject and a list of fetched entries.
applyMiddlewares :: [Middleware] -> Directory -> Directory Source #
Applies, from left to right, given middlewares to the directory.
applySteps :: MonadThrow m => Directory -> [Step m] -> m Directory Source #
Applies, from left to right, a list of steps to given directory.
emptyDirectory :: Subject -> Directory Source #
Creates a directory with given subject and no entries.