Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for comment in submissions.new.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to the new submissions endpoint.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self._reddit, API_PATH["subreddit_new"].format(sub=self.display_name), subreddit=self,
*args, **kwargs)
for comment in subreddit.mod.modqueue.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to grab items in the modqueue.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self.subreddit._reddit,
API_PATH["subreddit_modqueue"].format(sub=self.subreddit.display_name),
subreddit=self.subreddit, *args, **kwargs)
def top(self, *args, **kwargs):
r"""
Returns an instance of :class:`~apraw.models.ListingGenerator` mapped to the top submissions endpoint.
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to the top submissions endpoint.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self._reddit, API_PATH["subreddit_top"].format(sub=self.display_name), subreddit=self,
*args, **kwargs)
async def unread(self, *args, **kwargs) -> ListingGenerator:
return ListingGenerator(self.reddit, API_PATH["message_unread"], *args, **kwargs)
for comment in subreddit.mod.log.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to grab mod actions in the subreddit log.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self.subreddit._reddit,
API_PATH["subreddit_log"].format(sub=self.subreddit.display_name),
subreddit=self.subreddit, *args, **kwargs)
def hot(self, *args, **kwargs):
r"""
Returns an instance of :class:`~apraw.models.ListingGenerator` mapped to the hot submissions endpoint.
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to the hot submissions endpoint.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self._reddit, API_PATH["subreddit_hot"].format(sub=self.display_name), subreddit=self,
*args, **kwargs)
for comment in subreddit.wiki.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to recent wikipage revisions.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self.subreddit._reddit, API_PATH["wiki_revisions"].format(sub=self.subreddit), *args,
**kwargs)
for comment in subreddit.mod.spam.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to grab items marked as spam.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self.subreddit._reddit,
API_PATH["subreddit_spam"].format(sub=self.subreddit.display_name),
subreddit=self.subreddit, *args, **kwargs)
def rising(self, *args, **kwargs):
r"""
Returns an instance of :class:`~apraw.models.ListingGenerator` mapped to the rising submissions endpoint.
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to the rising submissions endpoint.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self._reddit, API_PATH["subreddit_rising"].format(sub=self.display_name), *args,
**kwargs)
for comment in redditor.comments.stream():
print(comment)
Parameters
----------
kwargs: \*\*Dict
:class:`~apraw.models.ListingGenerator` ``kwargs``.
Returns
-------
generator: ListingGenerator
A :class:`~apraw.models.ListingGenerator` mapped to fetch the Redditor's comments.
"""
from ..helpers.generator import ListingGenerator
return ListingGenerator(self.reddit, API_PATH["user_comments"].format(user=self), *args, **kwargs)