-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Access to the Readability API. -- @package hsreadability @version 1.0.0.0 -- | This module is an interface to the Readability's Parser API. -- -- To get more info, visit -- https://www.readability.com/developers/api/parser. module Network.Readability.Parser -- | This is a Readability Parser API key. -- -- You can get one at -- https://www.readability.com/settings/account. newtype ParserToken ParserToken :: ByteString -> ParserToken data Article Article :: Maybe Text -> Maybe Text -> Maybe Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Integer -> Maybe Integer -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Article -- | The main content of the article (in HTML) content :: Article -> Maybe Text -- | Domain name of article host domain :: Article -> Maybe Text author :: Article -> Maybe Text -- | URL of the article url :: Article -> Text -- | Shortened URL provided by Readability Shortener short_url :: Article -> Maybe Text title :: Article -> Maybe Text excerpt :: Article -> Maybe Text -- | Text direction of article direction :: Article -> Maybe Text word_count :: Article -> Integer -- | Total number of pages in article total_pages :: Article -> Maybe Integer date_published :: Article -> Maybe Text dek :: Article -> Maybe Text lead_image_url :: Article -> Maybe Text next_page_id :: Article -> Maybe Text rendered_pages :: Article -> Maybe Int -- | Parses content of the given article and returns its description. -- -- This is a GET request to /parser endpoint. parse :: ParserToken -> Maybe ByteString -> Maybe ByteString -> Maybe Int -> IO (Either String Article) -- | Parses content of the article by URL. -- -- This is a shortcut for parse. parseByUrl :: ParserToken -> ByteString -> Maybe Int -> IO (Either String Article) -- | Parses content of the article by article id. -- -- This is a shortcut for parse. parseById :: ParserToken -> ByteString -> Maybe Int -> IO (Either String Article) -- | Represents article status data ArticleStatus ArticleStatus :: ByteString -> Status -> ArticleStatus -- | Article id as_article_id :: ArticleStatus -> ByteString -- | Article status as_article_status :: ArticleStatus -> Status data Status -- | Unable to parse this URL for some reason Invalid :: Status -- | Readability knows of this article but hasn't yet retrieved its -- content, or the cache expired Unretrieved :: Status -- | The content of this URL has been retrieved from at least one user ProvidedByUser :: Status -- | The content was retrieved from multiple users and is validated ValidatedByUsers :: Status -- | The content of this URL was fetched manually, and it has been cached Fetched :: Status -- | Gets article's status. -- -- This is a HEAD request to /parser endpoint. getContentStatus :: ParserToken -> Maybe ByteString -> Maybe ByteString -> IO (Maybe ArticleStatus) -- | Gets article's status by URL. -- -- This functions is a shortcut for getContentStatus. getContentStatusByUrl :: ParserToken -> ByteString -> IO (Maybe ArticleStatus) -- | Gets article's status by id. -- -- This functions is a shortcut for getContentStatus. getContentStatusById :: ParserToken -> ByteString -> IO (Maybe ArticleStatus) -- | This type represent confidence with which Readability Parser -- recognizes content of article. data Confidence Confidence :: Text -> Double -> Confidence -- | Article URL conf_url :: Confidence -> Text -- | Parser's confidence conf_confidence :: Confidence -> Double -- | Gets parser's confidence by URL. -- -- This a GET request to /confidence getConfidence :: ByteString -> IO (Either String Confidence) instance Show Status instance Eq Status instance Show ArticleStatus instance Eq ArticleStatus instance FromJSON Confidence instance Show Confidence instance Eq Confidence instance FromJSON Article instance Eq ParserToken instance Show ParserToken instance Show Article instance Eq Article -- | This module is an interface to the Readability's Reader API. -- -- To get more info, visit -- https://www.readability.com/developers/api/reader. -- -- Before performing any request, you should receive OAuth credentials. -- To do that, this module provides newOAuth as well as -- xauth for XAuth authorizations. -- -- The full XAuth authorization process will be like: -- --
-- let auth = newAuth
-- { oauthConsumerKey = "consumer key" -- usually, your username
-- , oauthConsumerSecret = "consumer token"
-- }
-- credential <- xauth auth "username" "password"
--
--
-- Then you should pass auth and credential to any function in this
-- module.
--
-- It's preferable not doing authentication every single time. The best
-- way is to store received credential, so you can use it later.
--
-- If you don't have Reader Keys, visit
-- https://www.readability.com/settings/account.
module Network.Readability.Reader
-- | Data type for OAuth client (consumer).
--
-- The constructor for this data type is not exposed. Instead, you should
-- use the def method or newOAuth function to retrieve a
-- default instance, and then use the records below to make
-- modifications. This approach allows us to add configuration options
-- without breaking backwards compatibility.
data OAuth :: *
-- | Default value for OAuth datatype. You must specify at least consumer
-- key and secret.
--
-- Example usage:
--
--
-- myAuth = newOAuth
-- { oauthConsumerKey = "consumer key"
-- , oauthConsumerSecret = "consumer secret"
-- }
--
newOAuth :: OAuth
-- | Consumer key (You MUST specify)
oauthConsumerKey :: OAuth -> ByteString
-- | Consumer Secret (You MUST specify)
oauthConsumerSecret :: OAuth -> ByteString
-- | XAuth is used to receive OAuth token using owner's username and
-- password directly.
--
-- In most cases, you should do your best to support OAuth proper.
xauth :: OAuth -> ByteString -> ByteString -> IO (Maybe Credential)
-- | OAuth endpoint
oauthAuthorizeEndpoint :: String
-- | OAuth endpoint
oauthRequestTokenEndpoint :: String
-- | OAuth endpoint
oauthAccessTokenEndpoint :: String
data Article
Article :: Maybe Text -> Maybe Text -> Maybe Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Integer -> Maybe Integer -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Article
-- | The main content of the article (in HTML)
content :: Article -> Maybe Text
-- | Domain name of article host
domain :: Article -> Maybe Text
author :: Article -> Maybe Text
-- | URL of the article
url :: Article -> Text
-- | Shortened URL provided by Readability Shortener
short_url :: Article -> Maybe Text
title :: Article -> Maybe Text
excerpt :: Article -> Maybe Text
-- | Text direction of article
direction :: Article -> Maybe Text
word_count :: Article -> Integer
-- | Total number of pages in article
total_pages :: Article -> Maybe Integer
date_published :: Article -> Maybe Text
dek :: Article -> Maybe Text
lead_image_url :: Article -> Maybe Text
next_page_id :: Article -> Maybe Text
rendered_pages :: Article -> Maybe Int
-- | Gets article by id.
--
-- This is a GET request to /articles/{articleId}
-- endpoint.
getArticle :: OAuth -> Credential -> ByteString -> IO (Either String Article)
data BookmarksFilters
BookmarksFilters :: Maybe Bool -> Maybe Bool -> Maybe String -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> Maybe DateTime -> BookmarksFilters
-- | Archieved status
bfArchive :: BookmarksFilters -> Maybe Bool
bfFavorite :: BookmarksFilters -> Maybe Bool
bfDomain :: BookmarksFilters -> Maybe String
bfAddedSince :: BookmarksFilters -> Maybe DateTime
bfAddedUntil :: BookmarksFilters -> Maybe DateTime
bfOpenedSince :: BookmarksFilters -> Maybe DateTime
bfOpenedUntil :: BookmarksFilters -> Maybe DateTime
bfArchivedSince :: BookmarksFilters -> Maybe DateTime
bfArchivedUntil :: BookmarksFilters -> Maybe DateTime
bfFavoritedSince :: BookmarksFilters -> Maybe DateTime
bfFavoritedUntil :: BookmarksFilters -> Maybe DateTime
bfUpdatedSince :: BookmarksFilters -> Maybe DateTime
bfUpdatedUntil :: BookmarksFilters -> Maybe DateTime
-- | This is a default value for BookmarksFilters. All fields are
-- set to Nothing.
defaultBookmarksFilters :: BookmarksFilters
data BookmarksResponse
BookmarksResponse :: BookmarksConditions -> BookmarksMeta -> [Bookmark] -> BookmarksResponse
br_conditions :: BookmarksResponse -> BookmarksConditions
br_meta :: BookmarksResponse -> BookmarksMeta
br_bookmarks :: BookmarksResponse -> [Bookmark]
data BookmarksConditions
BookmarksConditions :: Maybe Int -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Order -> Maybe Text -> Maybe Integer -> Maybe Integer -> Maybe Text -> BookmarksConditions
bc_archive :: BookmarksConditions -> Maybe Int
bc_favorite :: BookmarksConditions -> Maybe Int
bc_domain :: BookmarksConditions -> Maybe Text
bc_added_since :: BookmarksConditions -> Maybe Text
bc_added_until :: BookmarksConditions -> Maybe Text
bc_opened_since :: BookmarksConditions -> Maybe Text
bc_opened_until :: BookmarksConditions -> Maybe Text
bc_archived_since :: BookmarksConditions -> Maybe Text
bc_archived_until :: BookmarksConditions -> Maybe Text
bc_favorited_since :: BookmarksConditions -> Maybe Text
bc_favorited_until :: BookmarksConditions -> Maybe Text
bc_updated_since :: BookmarksConditions -> Maybe Text
bc_updated_until :: BookmarksConditions -> Maybe Text
bc_order :: BookmarksConditions -> Maybe Order
bc_user :: BookmarksConditions -> Maybe Text
bc_page :: BookmarksConditions -> Maybe Integer
bc_per_page :: BookmarksConditions -> Maybe Integer
bc_exclude_accessibility :: BookmarksConditions -> Maybe Text
data BookmarksMeta
BookmarksMeta :: Maybe Integer -> Maybe Integer -> Maybe Integer -> Maybe Integer -> BookmarksMeta
bmeta_num_pages :: BookmarksMeta -> Maybe Integer
bmeta_page :: BookmarksMeta -> Maybe Integer
bmeta_item_count_total :: BookmarksMeta -> Maybe Integer
bmeta_item_count :: BookmarksMeta -> Maybe Integer
data Bookmark
Bookmark :: Integer -> Text -> Text -> Bool -> Bool -> Article -> Integer -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Text -> [Tag] -> Bookmark
b_user_id :: Bookmark -> Integer
b_read_percent :: Bookmark -> Text
b_date_updated :: Bookmark -> Text
b_favorite :: Bookmark -> Bool
b_archive :: Bookmark -> Bool
b_article :: Bookmark -> Article
b_id :: Bookmark -> Integer
b_date_archived :: Bookmark -> Maybe Text
b_date_opened :: Bookmark -> Maybe Text
b_date_added :: Bookmark -> Maybe Text
b_date_favorited :: Bookmark -> Maybe Text
b_article_href :: Bookmark -> Text
b_tags :: Bookmark -> [Tag]
data BookmarkLocation
BookmarkLocation :: Maybe ByteString -> Maybe ByteString -> BookmarkLocation
blLocation :: BookmarkLocation -> Maybe ByteString
blArticleLocation :: BookmarkLocation -> Maybe ByteString
data Order
-- | Sort by date added, asceding
DateAddedAsc :: Order
-- | Sort by date added, desceding (this is default)
DateAddedDesc :: Order
-- | Sort by date updated, asceding
DateUpdatedAsc :: Order
-- | Sort by date updated, desceding
DateUpdatedDesc :: Order
-- | Get all user bookmarks.
--
-- This is a GET request to /bookmarks.
getBookmarks :: OAuth -> Credential -> BookmarksFilters -> Maybe Order -> Maybe Integer -> Maybe Integer -> Maybe Bool -> [String] -> IO (Either String BookmarksResponse)
-- | Add bookmark.
--
-- This is a POST request to /bookmarks.
addBookmark :: OAuth -> Credential -> ByteString -> Maybe Bool -> Maybe Bool -> Maybe Bool -> IO BookmarkLocation
-- | Get bookmark by id.
--
-- This is a GET request to /bookmarks/{bookmarkId}.
getBookmark :: OAuth -> Credential -> Integer -> IO (Either String Bookmark)
-- | Update bookmark.
--
-- This a POST request to /bookmarks/{bookmarkId}.
updateBookmark :: OAuth -> Credential -> Integer -> Maybe Bool -> Maybe Bool -> Maybe Double -> IO (Either String Bookmark)
-- | Delete bookmark by id.
--
-- This is a DELETE request to /bookmarks/{bookmarkId}.
deleteBookmark :: OAuth -> Credential -> Integer -> IO (Response ByteString)
-- | Get bookmark tags
--
-- This is a GET request to
-- /bookmarks/{bookmarkId}/tags.
getBookmarkTags :: OAuth -> Credential -> Integer -> IO (Either String TagsResponse)
-- | Add tags to bookmark.
--
-- This is a POST request to
-- /bookmarks/{bookmarkId}/tags.
addBookmarkTags :: OAuth -> Credential -> Integer -> [Text] -> IO (Either String TagsResponse)
-- | Delete given tag from bookmark.
--
-- This is a DELETE request to
-- /bookmark/{bookmarkId}/tags/{tagId}.
deleteBookmarkTag :: OAuth -> Credential -> Integer -> Integer -> IO (Response ByteString)
data TagsResponse
TagsResponse :: [Tag] -> TagsResponse
tr_tags :: TagsResponse -> [Tag]
data Tag
Tag :: Text -> Integer -> Maybe Integer -> Maybe [Integer] -> Tag
t_text :: Tag -> Text
t_id :: Tag -> Integer
t_applied_count :: Tag -> Maybe Integer
t_bookmark_ids :: Tag -> Maybe [Integer]
-- | Retrieve all user tags.
--
-- This is a GET request to /tags.
getTags :: OAuth -> Credential -> IO (Either String TagsResponse)
-- | Retrieve tag by id.
--
-- This is a GET request to /tags/{tagId}.
getTag :: OAuth -> Credential -> Integer -> IO (Either String Tag)
-- | Delete tag by id.
--
-- This is a DELETE request to /tags/{tagId}.
deleteTag :: OAuth -> Credential -> Integer -> IO (Response ByteString)
data User
User :: Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Integer -> Maybe Text -> Maybe Text -> [Tag] -> User
u_username :: User -> Text
u_first_name :: User -> Maybe Text
u_second_name :: User -> Maybe Text
u_date_joined :: User -> Maybe Text
u_has_active_subscriptions :: User -> Maybe Bool
u_reading_limit :: User -> Maybe Integer
u_email_into_address :: User -> Maybe Text
u_kindle_email_address :: User -> Maybe Text
u_tags :: User -> [Tag]
-- | Retrieve current user info.
--
-- This is a GET request to /user/_current.
getUser :: OAuth -> Credential -> IO (Either String User)
instance FromJSON User
instance Eq User
instance Show User
instance FromJSON TagsResponse
instance Eq BookmarkLocation
instance Show BookmarkLocation
instance Eq TagsResponse
instance Show TagsResponse
instance FromJSON BookmarksResponse
instance Eq BookmarksResponse
instance Show BookmarksResponse
instance FromJSON Bookmark
instance Eq Bookmark
instance Show Bookmark
instance FromJSON Tag
instance Eq Tag
instance Show Tag
instance FromJSON BookmarksMeta
instance Eq BookmarksMeta
instance Show BookmarksMeta
instance FromJSON BookmarksConditions
instance Show BookmarksFilters
instance Eq BookmarksFilters
instance Eq Order
instance Eq BookmarksConditions
instance Show BookmarksConditions
instance FromJSON Order
instance Show Order
instance Default BookmarksFilters
-- | This module is an interface to the Readability's Shortener API.
--
-- To get more info, visit
-- https://www.readability.com/developers/api/shortener.
module Network.Readability.Shortener
data Article
Article :: Maybe Text -> Maybe Text -> Maybe Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Integer -> Maybe Integer -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Article
-- | The main content of the article (in HTML)
content :: Article -> Maybe Text
-- | Domain name of article host
domain :: Article -> Maybe Text
author :: Article -> Maybe Text
-- | URL of the article
url :: Article -> Text
-- | Shortened URL provided by Readability Shortener
short_url :: Article -> Maybe Text
title :: Article -> Maybe Text
excerpt :: Article -> Maybe Text
-- | Text direction of article
direction :: Article -> Maybe Text
word_count :: Article -> Integer
-- | Total number of pages in article
total_pages :: Article -> Maybe Integer
date_published :: Article -> Maybe Text
dek :: Article -> Maybe Text
lead_image_url :: Article -> Maybe Text
next_page_id :: Article -> Maybe Text
rendered_pages :: Article -> Maybe Int
-- | Contains main data
data ShortenerMeta
ShortenerMeta :: Maybe Article -> Maybe Text -> Text -> Text -> Maybe Text -> ShortenerMeta
smeta_article :: ShortenerMeta -> Maybe Article
smeta_url :: ShortenerMeta -> Maybe Text
-- | The shortened URL
smeta_rdd_url :: ShortenerMeta -> Text
-- | The id of shortened URL
smeta_id :: ShortenerMeta -> Text
-- | The Article URL
smeta_full_url :: ShortenerMeta -> Maybe Text
-- | Response from Shortener API
data ShortenerResponse
ShortenerResponse :: ShortenerMeta -> [Text] -> Bool -> ShortenerResponse
se_meta :: ShortenerResponse -> ShortenerMeta
-- | The response messages
se_messages :: ShortenerResponse -> [Text]
se_success :: ShortenerResponse -> Bool
-- | Create a new shortened URL
--
-- This is a POST request to /urls.
shortenUrl :: String -> IO (Either String ShortenerResponse)
-- | Retrieve a single shortened URL
--
-- This is a GET request to /urls/{urlId}.
retrieveUrl :: String -> IO (Either String ShortenerResponse)
instance FromJSON ShortenerResponse
instance FromJSON ShortenerMeta
instance Show ShortenerMeta
instance Show ShortenerResponse
-- | This module merely reexports other modules for ease of use.
module Network.Readability