Copyright | (c) 2021 Rory Tyler Hayford |
---|---|
License | BSD-3-Clause |
Maintainer | rory.hayford@protonmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Actions related to users, excluding the currently logged-in one. For actions on the current account, see Network.Reddit.Me
Synopsis
- isUsernameAvailable :: MonadReddit m => Username -> m Bool
- getUser :: MonadReddit m => Username -> m Account
- getUserTrophies :: MonadReddit m => Username -> m (Seq Trophy)
- getUserComments :: MonadReddit m => Username -> Paginator CommentID Comment -> m (Listing CommentID Comment)
- getUserSubmissions :: MonadReddit m => Username -> Paginator SubmissionID Submission -> m (Listing SubmissionID Submission)
- getUserUpvoted :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserDownvoted :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserHidden :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserOverview :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserGilded :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserSaved :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item)
- getUserMultireddits :: MonadReddit m => Username -> m (Seq Multireddit)
- getNewUsers :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit)
- getPopularUsers :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit)
- searchUsers :: MonadReddit m => Text -> Paginator UserID Account -> m (Listing UserID Account)
- getUserSummaries :: (MonadReddit m, Foldable t) => t UserID -> m (Seq UserSummary)
- getUserSummary :: MonadReddit m => UserID -> m UserSummary
- data AcceptPMs
- data MediaPreference
- data Preferences = Preferences ItemSort MediaPreference MediaPreference Int Int Int Int Text AcceptPMs Bool Bool Bool Bool Bool Bool (Maybe Bool) Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool (Maybe Bool) Bool Bool Bool Bool Bool Bool Bool Bool (Maybe Bool) Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool (Maybe Bool) Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool Bool
- data UserSummary = UserSummary (Maybe UserID) Username Integer Integer UTCTime URL (Maybe RGBText) Bool
- data Trophy = Trophy Name (Maybe Text) (Maybe Text) (Maybe Body) (Maybe UTCTime)
- data Karma = Karma SubredditName Integer Integer
- data Friend = Friend Username UserID UTCTime (Maybe Text)
- data AccountSearchSort
- data AccountSearchOpts = AccountSearchOpts AccountSearchSort (Maybe Bool) (Maybe Text)
- data Account = Account UserID Username UTCTime Int Bool Bool Int (Maybe Integer) (Maybe Text) (Maybe Bool) (Maybe Bool) (Maybe Bool) (Maybe Bool)
- newtype UserID = UserID Text
- data Username
- mkUsername :: MonadThrow m => Text -> m Username
Actions
isUsernameAvailable :: MonadReddit m => Username -> m Bool Source #
Check if a Username
is available for use
getUserTrophies :: MonadReddit m => Username -> m (Seq Trophy) Source #
Get a user's Trophy
s
getUserComments :: MonadReddit m => Username -> Paginator CommentID Comment -> m (Listing CommentID Comment) Source #
getUserSubmissions :: MonadReddit m => Username -> Paginator SubmissionID Submission -> m (Listing SubmissionID Submission) Source #
Get a Listing
of a user's Submission
s
getUserUpvoted :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get Item
s that a user has upvoted. You must be authorized to access this,
or an exception will be raised
getUserDownvoted :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get Item
s that a user has upvoted. You must be authorized to access this,
or an exception will be raised
getUserHidden :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get Item
s that a user has hidden. You must be authorized to access this,
or an exception will be raised
getUserOverview :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get an overview of a user's Comment
s and Submission
s
getUserGilded :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get the Item
s that a user has gilded
getUserSaved :: MonadReddit m => Username -> Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get the Item
s that a user has saved. You must be authorized to access this,
or an exception will be raised
getUserMultireddits :: MonadReddit m => Username -> m (Seq Multireddit) Source #
Get the public Multireddit
s belonging to the given user
User Listing
s and summaries
These actions return Listing
s for special user subreddits,
user accounts, or UserSummary
s for existing user IDs
getNewUsers :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit) Source #
Get a Listing
of special user subreddits, sorted on creation date (newest
first)
getPopularUsers :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit) Source #
Get a Listing
of special user subreddits, sorted on popularity
searchUsers :: MonadReddit m => Text -> Paginator UserID Account -> m (Listing UserID Account) Source #
Get a Listing
of user profiles whose titles and descriptions which match
the given query
getUserSummaries :: (MonadReddit m, Foldable t) => t UserID -> m (Seq UserSummary) Source #
Get a brief UserSummary
for each valid UserID
. Note that Reddit silently
ignores invalid IDs, so the output may be shorted than the input container
getUserSummary :: MonadReddit m => UserID -> m UserSummary Source #
Get the UserSummary
for a single user ID
Types
Policy for accepting private messages, for use in user Preferences
data MediaPreference Source #
How to deal with media previews and thumbnails in your Preferences
Instances
data Preferences Source #
User preferences
Instances
data UserSummary Source #
A brief summary of a user, with significantly less information than a
Account
Instances
A Reddit award, such as the "one-year club"
Instances
Eq Trophy Source # | |
Show Trophy Source # | |
Generic Trophy Source # | |
FromJSON Trophy Source # | |
type Rep Trophy Source # | |
Defined in Network.Reddit.Types.Account type Rep Trophy = D1 ('MetaData "Trophy" "Network.Reddit.Types.Account" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Trophy" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Name) :*: S1 ('MetaSel ('Just "trophyID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "awardID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Body)) :*: S1 ('MetaSel ('Just "grantedAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe UTCTime)))))) |
Information about a user's karma
Instances
Eq Karma Source # | |
Show Karma Source # | |
Generic Karma Source # | |
FromJSON Karma Source # | |
type Rep Karma Source # | |
Defined in Network.Reddit.Types.Account type Rep Karma = D1 ('MetaData "Karma" "Network.Reddit.Types.Account" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Karma" 'PrefixI 'True) (S1 ('MetaSel ('Just "subreddit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubredditName) :*: (S1 ('MetaSel ('Just "commentKarma") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "linkKarma") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer)))) |
A user's friend
Instances
Eq Friend Source # | |
Show Friend Source # | |
Generic Friend Source # | |
FromJSON Friend Source # | |
type Rep Friend Source # | |
Defined in Network.Reddit.Types.Account type Rep Friend = D1 ('MetaData "Friend" "Network.Reddit.Types.Account" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Friend" 'PrefixI 'True) ((S1 ('MetaSel ('Just "username") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Username) :*: S1 ('MetaSel ('Just "userID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UserID)) :*: (S1 ('MetaSel ('Just "since") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "note") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) |
data AccountSearchSort Source #
The item sort for Account
searches
Instances
Eq AccountSearchSort Source # | |
Defined in Network.Reddit.Types.Account (==) :: AccountSearchSort -> AccountSearchSort -> Bool # (/=) :: AccountSearchSort -> AccountSearchSort -> Bool # | |
Show AccountSearchSort Source # | |
Defined in Network.Reddit.Types.Account showsPrec :: Int -> AccountSearchSort -> ShowS # show :: AccountSearchSort -> String # showList :: [AccountSearchSort] -> ShowS # | |
Generic AccountSearchSort Source # | |
Defined in Network.Reddit.Types.Account type Rep AccountSearchSort :: Type -> Type # from :: AccountSearchSort -> Rep AccountSearchSort x # to :: Rep AccountSearchSort x -> AccountSearchSort # | |
ToHttpApiData AccountSearchSort Source # | |
Defined in Network.Reddit.Types.Account toUrlPiece :: AccountSearchSort -> Text # toEncodedUrlPiece :: AccountSearchSort -> Builder # toHeader :: AccountSearchSort -> ByteString # toQueryParam :: AccountSearchSort -> Text # | |
type Rep AccountSearchSort Source # | |
Defined in Network.Reddit.Types.Account |
data AccountSearchOpts Source #
Options for search Listing
s of Account
s
Instances
Account information. Maybe
fields denote data that Reddit sets to null if
the requester does not own the account in question. Note that this does not
include all of the possible fields that may be present in Reddit's response -
which are quite numerous in total and poorly documented
Account UserID Username UTCTime Int Bool Bool Int (Maybe Integer) (Maybe Text) (Maybe Bool) (Maybe Bool) (Maybe Bool) (Maybe Bool) |
Instances
A unique, site-wide ID for an account
Reddit username
Instances
Eq Username Source # | |
Show Username Source # | |
Generic Username Source # | |
ToJSON Username Source # | |
Defined in Network.Reddit.Types.Account | |
FromJSON Username Source # | |
ToHttpApiData Username Source # | |
Defined in Network.Reddit.Types.Account toUrlPiece :: Username -> Text # toEncodedUrlPiece :: Username -> Builder # toHeader :: Username -> ByteString # toQueryParam :: Username -> Text # | |
type Rep Username Source # | |
Defined in Network.Reddit.Types.Account |
mkUsername :: MonadThrow m => Text -> m Username Source #
Smart constructor for Username
, which must be between 3 and 20 chars,
and may only include upper/lowercase alphanumeric chars, underscores, or
hyphens