reddit.front
- class praw.models.Front(reddit: praw.Reddit)
Front is a Listing class that represents the front page.
- __init__(reddit: praw.Reddit)
Initialize a
Front
instance.
- best(**generator_kwargs: Union[str, int]) Iterator[praw.models.Submission]
Return a
ListingGenerator
for best items.Additional keyword arguments are passed in the initialization of
ListingGenerator
.
- comments() praw.models.listing.mixins.subreddit.CommentHelper
Provide an instance of
CommentHelper
.For example, to output the author of the 25 most recent comments of r/test execute:
for comment in reddit.subreddit("test").comments(limit=25): print(comment.author)
- controversial(*, time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for controversial items.- Parameters
time_filter – Can be one of:
"all"
,"day"
,"hour"
,"month"
,"week"
, or"year"
(default:"all"
).- Raises
ValueError
iftime_filter
is invalid.
Additional keyword arguments are passed in the initialization of
ListingGenerator
.This method can be used like:
reddit.domain("imgur.com").controversial(time_filter="week") reddit.multireddit(redditor="samuraisam", name="programming").controversial( time_filter="day" ) reddit.redditor("spez").controversial(time_filter="month") reddit.redditor("spez").comments.controversial(time_filter="year") reddit.redditor("spez").submissions.controversial(time_filter="all") reddit.subreddit("all").controversial(time_filter="hour")
- gilded(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for gilded items.Additional keyword arguments are passed in the initialization of
ListingGenerator
.For example, to get gilded items in r/test:
for item in reddit.subreddit("test").gilded(): print(item.id)
- hot(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for hot items.Additional keyword arguments are passed in the initialization of
ListingGenerator
.This method can be used like:
reddit.domain("imgur.com").hot() reddit.multireddit(redditor="samuraisam", name="programming").hot() reddit.redditor("spez").hot() reddit.redditor("spez").comments.hot() reddit.redditor("spez").submissions.hot() reddit.subreddit("all").hot()
- new(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for new items.Additional keyword arguments are passed in the initialization of
ListingGenerator
.This method can be used like:
reddit.domain("imgur.com").new() reddit.multireddit(redditor="samuraisam", name="programming").new() reddit.redditor("spez").new() reddit.redditor("spez").comments.new() reddit.redditor("spez").submissions.new() reddit.subreddit("all").new()
- classmethod parse(data: Dict[str, Any], reddit: praw.Reddit) Any
Return an instance of
cls
fromdata
.- Parameters
data – The structured data.
reddit – An instance of
Reddit
.
- random_rising(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[praw.models.Submission]
Return a
ListingGenerator
for random rising submissions.Additional keyword arguments are passed in the initialization of
ListingGenerator
.For example, to get random rising submissions for r/test:
for submission in reddit.subreddit("test").random_rising(): print(submission.title)
- rising(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[praw.models.Submission]
Return a
ListingGenerator
for rising submissions.Additional keyword arguments are passed in the initialization of
ListingGenerator
.For example, to get rising submissions for r/test:
for submission in reddit.subreddit("test").rising(): print(submission.title)
- top(*, time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for top items.- Parameters
time_filter – Can be one of:
"all"
,"day"
,"hour"
,"month"
,"week"
, or"year"
(default:"all"
).- Raises
ValueError
iftime_filter
is invalid.
Additional keyword arguments are passed in the initialization of
ListingGenerator
.This method can be used like:
reddit.domain("imgur.com").top(time_filter="week") reddit.multireddit(redditor="samuraisam", name="programming").top(time_filter="day") reddit.redditor("spez").top(time_filter="month") reddit.redditor("spez").comments.top(time_filter="year") reddit.redditor("spez").submissions.top(time_filter="all") reddit.subreddit("all").top(time_filter="hour")