Copyright | (c) Mateusz Kowalczyk 2013-2014 |
---|---|
License | GPL-3 |
Maintainer | fuuzetsu@fuuzetsu.co.uk |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Module providing functions to interface with some booru sites. Amongst other things, it should (semi-transparently) handle post count limits. The user should simply be able to ask for all images with certain rather than worrying about hard limits per page set by the sites &c.
- fetchTaggedPosts :: (Postable s d, CoerceResponse d r) => s -> d -> [Tag] -> ExcIO [ImageTy s d]
- fetchTaggedPostsIndexed :: (CoerceResponse r a, PostablePaged s r) => s -> r -> [Tag] -> Integer -> ExcIO [ImageTy s r]
- fetchPostPage :: (Postable s d, CoerceResponse d r) => s -> d -> [Tag] -> ExcIO r
- fetchPostPageIndexed :: (PostablePaged s d, CoerceResponse d r) => s -> d -> [Tag] -> Integer -> ExcIO r
- fetchResponse :: CoerceResponse r r' => String -> r -> ExcIO r'
- fetchPostCount :: (Postable s r, Counted s r, CoerceResponse r a) => s -> r -> [Tag] -> ExcIO Integer
- fetchAllTaggedPosts :: (CoerceResponse r a, PostablePaged s r) => s -> r -> [Tag] -> IO [ImageTy s r]
- data DownloadStatus
- downloadFiles :: [(String, FilePath)] -> TChan DownloadStatus -> Int -> IO ()
Documentation
fetchTaggedPosts :: (Postable s d, CoerceResponse d r) => s -> d -> [Tag] -> ExcIO [ImageTy s d] Source
Given a Site
, DataFormat
and a list of Tag
s, naively fetch the first
page or so and parse it to the appropriate image type. Both the site and the
format need to together form an instance of Postable
and the data format
has to exist in an instance of CoerceResponse
. Uses fetchPostPage
to
fetch the data.
fetchTaggedPostsIndexed :: (CoerceResponse r a, PostablePaged s r) => s -> r -> [Tag] -> Integer -> ExcIO [ImageTy s r] Source
As fetchTaggedPosts
but works with sites which allow indexing by page.
fetchPostPage :: (Postable s d, CoerceResponse d r) => s -> d -> [Tag] -> ExcIO r Source
Given an instance of Postable
, CoerceResponse
, and a list of Tag
s,
fetch the post page.
fetchPostPageIndexed :: (PostablePaged s d, CoerceResponse d r) => s -> d -> [Tag] -> Integer -> ExcIO r Source
Given an instance of Postable
, CoerceResponse
, and a list of Tag
s,
fetch the post page.
fetchResponse :: CoerceResponse r r' => String -> r -> ExcIO r' Source
Given a URL and protocol, tries to fetch a response.
fetchPostCount :: (Postable s r, Counted s r, CoerceResponse r a) => s -> r -> [Tag] -> ExcIO Integer Source
Uses fetchPostPage
to parse the number of posts available based on
provided Tag
s.
fetchAllTaggedPosts :: (CoerceResponse r a, PostablePaged s r) => s -> r -> [Tag] -> IO [ImageTy s r] Source
Attemps to fetch all posts from a site, from all its pages. The upper limit of images per page is used.
data DownloadStatus Source