Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains post-related actions, like submitting a post, getting information for an existing post, and performing moderator actions on posts.
Synopsis
- getPosts :: Monad m => RedditT m PostListing
- getPosts' :: Monad m => Options PostID -> ListingType -> Maybe SubredditName -> RedditT m PostListing
- getPostComments :: Monad m => PostID -> RedditT m PostComments
- getPostSubComments :: Monad m => PostID -> CommentID -> RedditT m PostComments
- getComments :: Monad m => PostID -> RedditT m [CommentReference]
- getPostInfo :: Monad m => PostID -> RedditT m Post
- getPostsInfo :: Monad m => [PostID] -> RedditT m PostListing
- submitLink :: Monad m => SubredditName -> Text -> Text -> RedditT m PostID
- submitLinkWithCaptcha :: Monad m => SubredditName -> Text -> Text -> CaptchaID -> Text -> RedditT m PostID
- submitSelfPost :: Monad m => SubredditName -> Text -> Text -> RedditT m PostID
- submitSelfPostWithCaptcha :: Monad m => SubredditName -> Text -> Text -> CaptchaID -> Text -> RedditT m PostID
- setInboxReplies :: Monad m => Bool -> PostID -> RedditT m ()
- savePost :: Monad m => PostID -> RedditT m ()
- unsavePost :: Monad m => PostID -> RedditT m ()
- editPost :: Monad m => PostID -> Text -> RedditT m ()
- deletePost :: Monad m => PostID -> RedditT m ()
- setPostFlair :: Monad m => SubredditName -> PostID -> Text -> Text -> RedditT m ()
- removePost :: Monad m => PostID -> RedditT m ()
- markPostSpam :: Monad m => PostID -> RedditT m ()
- stickyPost :: Monad m => PostID -> Maybe Integer -> RedditT m ()
- unstickyPost :: Monad m => PostID -> Maybe Integer -> RedditT m ()
- setContestMode :: Monad m => Bool -> PostID -> RedditT m ()
Documentation
getPosts :: Monad m => RedditT m PostListing Source #
Get a PostListing
for the Hot
posts on the site overall.
This maps to http://reddit.com.
getPosts' :: Monad m => Options PostID -> ListingType -> Maybe SubredditName -> RedditT m PostListing Source #
Get a PostListing
for a specified listing.
getPostComments :: Monad m => PostID -> RedditT m PostComments Source #
Get a post and all its comments.
getPostSubComments :: Monad m => PostID -> CommentID -> RedditT m PostComments Source #
Get a post and a specific sub-tree of comments.
getComments :: Monad m => PostID -> RedditT m [CommentReference] Source #
Get the comments for a post. Ignore the actual post itself.
getPostInfo :: Monad m => PostID -> RedditT m Post Source #
Given a PostID
, getPostInfo
will return the full details for that post.
getPostsInfo :: Monad m => [PostID] -> RedditT m PostListing Source #
Given a list of PostID
s, getPostsInfo
will return another list containing
the full details for all the posts. Note that Reddit's
API imposes a limitation of 100 posts per request, so this function will fail immediately if given a list of more than 100 IDs.
:: Monad m | |
=> SubredditName | The subreddit to which you're posting the link |
-> Text | The title of the link post |
-> Text | The link that you're posting |
-> RedditT m PostID |
Submit a new link to Reddit.
submitLinkWithCaptcha Source #
:: Monad m | |
=> SubredditName | The subreddit to which you're posting the link |
-> Text | The title of the link post |
-> Text | The link that you're posting |
-> CaptchaID | The ID of the captcha we're answering |
-> Text | The answer to the provided captcha |
-> RedditT m PostID |
Submit a new link to Reddit (answering a Captcha to prove we aren't a robot).
:: Monad m | |
=> SubredditName | The subreddit to which you're posting the selfpost |
-> Text | The title of the selfpost |
-> Text | The body of the selfpost |
-> RedditT m PostID |
Submit a new selfpost to Reddit.
submitSelfPostWithCaptcha Source #
:: Monad m | |
=> SubredditName | The subreddit to which you're posting the selfpost |
-> Text | The title of the selfpost |
-> Text | The body of the selfpost |
-> CaptchaID | The ID of the captcha we're answering |
-> Text | The answer to the provided captcha |
-> RedditT m PostID |
Submit a new selfpost to Reddit (answering a Captcha to prove we aren't a robot).
setInboxReplies :: Monad m => Bool -> PostID -> RedditT m () Source #
Set the state of inbox replies for the specified thread.
unsavePost :: Monad m => PostID -> RedditT m () Source #
Remove a saved post from your "saved posts" list.
deletePost :: Monad m => PostID -> RedditT m () Source #
Deletes one of your own posts. Note that this is different from removing a post as a moderator action.
:: Monad m | |
=> SubredditName | The subreddit on which to set the flair |
-> PostID | The post whose flair should be set |
-> Text | The text label for the post's new flair |
-> Text | The CSS class for the post's new flair |
-> RedditT m () |
Set the link flair for a post you've submitted (or any post on a subreddit that you moderate).
removePost :: Monad m => PostID -> RedditT m () Source #
Removes a post (as a moderator action). Note that this is different from deleting a post.
markPostSpam :: Monad m => PostID -> RedditT m () Source #
Mark a post as spam as a moderator action.
:: Monad m | |
=> PostID | The post to be stickied |
-> Maybe Integer | The position to which it should be stickied |
-> RedditT m () |
Sticky a post on the subreddit on which it's posted.