SubListing
- class praw.models.listing.mixins.redditor.SubListing(reddit: praw.Reddit, base_path: str, subpath: str)
Helper class for generating
ListingGenerator
objects.- __init__(reddit: praw.Reddit, base_path: str, subpath: str)
Initialize a SubListing instance.
- Parameters
reddit – An instance of
Reddit
.base_path – The path to the object up to this point.
subpath – The additional path to this sublisting.
- controversial(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for controversial submissions.- Parameters
time_filter – Can be one of: all, day, hour, month, week, 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("week") reddit.multireddit("samuraisam", "programming").controversial("day") reddit.redditor("spez").controversial("month") reddit.redditor("spez").comments.controversial("year") reddit.redditor("spez").submissions.controversial("all") reddit.subreddit("all").controversial("hour")
- 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("samuraisam", "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("samuraisam", "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
.
- top(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]
Return a
ListingGenerator
for top submissions.- Parameters
time_filter – Can be one of: all, day, hour, month, week, 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("week") reddit.multireddit("samuraisam", "programming").top("day") reddit.redditor("spez").top("month") reddit.redditor("spez").comments.top("year") reddit.redditor("spez").submissions.top("all") reddit.subreddit("all").top("hour")