DomainListing

class asyncpraw.models.DomainListing(reddit: asyncpraw.Reddit, domain: str)

Provide a set of functions to interact with domain listings.

__init__(reddit: asyncpraw.Reddit, domain: str)

Initialize a DomainListing instance.

Parameters
  • reddit – An instance of Reddit.

  • domain – The domain for which to obtain listings.

controversial(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[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 if time_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")

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.controversial("day")

redditor = await reddit.redditor("spez")
redditor.controversial("month")

redditor = await reddit.redditor("spez")
redditor.comments.controversial("year")

redditor = await reddit.redditor("spez")
redditor.submissions.controversial("all")

subreddit = await reddit.subreddit("all")
subreddit.controversial("hour")
hot(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[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()

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.hot()

redditor = await reddit.redditor("spez")
redditor.hot()

redditor = await reddit.redditor("spez")
redditor.comments.hot()

redditor = await reddit.redditor("spez")
redditor.submissions.hot()

subreddit = await reddit.subreddit("all")
subreddit.hot()
new(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[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()

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.new()

redditor = await reddit.redditor("spez")
redditor.new()

redditor = await reddit.redditor("spez")
redditor.comments.new()

redditor = await reddit.redditor("spez")
redditor.submissions.new()

subreddit = await reddit.subreddit("all")
subreddit.new()
classmethod parse(data: Dict[str, Any], reddit: asyncpraw.Reddit) Any

Return an instance of cls from data.

Parameters
  • data – The structured data.

  • reddit – An instance of Reddit.

random_rising(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[asyncpraw.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:

subreddit = await reddit.subreddit("test")
async for submission in subreddit.random_rising():
    print(submission.title)
rising(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[asyncpraw.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:

subreddit = await reddit.subreddit("test")
async for submission in subreddit.rising():
    print(submission.title)
top(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[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 if time_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")

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.top("day")

redditor = await reddit.redditor("spez")
redditor.top("month")

redditor = await reddit.redditor("spez")
redditor.comments.top("year")

redditor = await reddit.redditor("spez")
redditor.submissions.top("all")

subreddit = await reddit.subreddit("all")
subreddit.top("hour")