reddit-0.1.0.0: Library for interfacing with Reddit's API

Safe HaskellNone
LanguageHaskell2010

Reddit.Actions.Post

Description

Contains post-related actions, like submitting a post, getting information for an existing post, and performing moderator actions on posts.

Synopsis

Documentation

getPosts :: MonadIO m => RedditT m PostListing Source

Get a PostListing for the Hot posts on the site overall. This maps to http://reddit.com.

getPostComments :: MonadIO m => PostID -> RedditT m PostComments Source

Get a post and all its comments.

getPostSubComments :: MonadIO m => PostID -> CommentID -> RedditT m PostComments Source

Get a post and a specific sub-tree of comments.

getComments :: MonadIO m => PostID -> RedditT m [CommentReference] Source

Get the comments for a post. Ignore the actual post itself.

getPostInfo :: MonadIO m => PostID -> RedditT m Post Source

Given a PostID, getPostInfo will return the full details for that post.

getPostsInfo :: MonadIO m => [PostID] -> RedditT m PostListing Source

Given a list of PostIDs, 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.

submitLink Source

Arguments

:: MonadIO 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

Arguments

:: MonadIO 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).

submitSelfPost Source

Arguments

:: MonadIO 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

Arguments

:: MonadIO 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 :: MonadIO m => Bool -> PostID -> RedditT m () Source

Set the state of inbox replies for the specified thread.

savePost :: MonadIO m => PostID -> RedditT m () Source

Save a post.

unsavePost :: MonadIO m => PostID -> RedditT m () Source

Remove a saved post from your "saved posts" list.

editPost :: MonadIO m => PostID -> Text -> RedditT m () Source

Edit the text of a self-post.

deletePost :: MonadIO m => PostID -> RedditT m () Source

Deletes one of your own posts. Note that this is different from removing a post as a moderator action.

setPostFlair Source

Arguments

:: MonadIO 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 :: MonadIO m => PostID -> RedditT m () Source

Removes a post (as a moderator action). Note that this is different from deleting a post.

markPostSpam :: MonadIO m => PostID -> RedditT m () Source

Mark a post as spam as a moderator action.

stickyPost Source

Arguments

:: MonadIO 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.

unstickyPost Source

Arguments

:: MonadIO m 
=> PostID

The post to be unstickied

-> Maybe Integer

The position from which it should be unstickied

-> RedditT m () 

Unsticky a post from the subreddit on which it's posted.

setContestMode :: MonadIO m => Bool -> PostID -> RedditT m () Source

Set the state of contest for the specified thread as a moderator action.