LiveThread¶
-
class
praw.models.LiveThread(reddit, id=None, _data=None)¶ An individual LiveThread object.
-
__getitem__(update_id)¶ Return a lazy
LiveUpdateinstance.Parameters: update_id – A live update ID, e.g., '7827987a-c998-11e4-a0b9-22000b6a88d2'.Usage:
thread = reddit.live('ukaeu1ik4sw5') update = thread['7827987a-c998-11e4-a0b9-22000b6a88d2'] update.thread # LiveThread(id='ukaeu1ik4sw5') update.id # '7827987a-c998-11e4-a0b9-22000b6a88d2' update.author # 'umbrae'
-
__init__(reddit, id=None, _data=None)¶ Initialize a lazy
LiveThreadinstance.Parameters: - reddit – An instance of
Reddit. - id – A live thread ID, e.g.,
'ukaeu1ik4sw5'
- reddit – An instance of
-
contrib¶ Provide an instance of
LiveThreadContribution.Usage:
thread = reddit.live('ukaeu1ik4sw5') thread.contrib.add('### update')
-
contributor¶ Provide an instance of
LiveContributorRelationship.You can call the instance to get a list of contributors which is represented as
RedditorListinstance consists ofRedditorinstances. Those Redditor instances havepermissionsattributes as contributors:thread = reddit.live('ukaeu1ik4sw5') for contributor in thread.contributor(): # prints `(Redditor(name='Acidtwist'), [u'all'])` print(contributor, contributor.permissions)
-
discussions(**generator_kwargs)¶ Get submissions linking to the thread.
Parameters: generator_kwargs – keyword arguments passed to ListingGeneratorconstructor.Returns: A ListingGeneratorobject which yieldsSubmissionobject.Usage:
thread = reddit.live('ukaeu1ik4sw5') for submission in thread.discussions(limit=None): print(submission.title)
-
fullname¶ Return the object’s fullname.
A fullname is an object’s kind mapping like
t3followed by an underscore and the object’s base36 ID, e.g.,t1_c5s96e0.
-
parse(data, reddit)¶ Return an instance of
clsfromdata.Parameters: - data – The structured data.
- reddit – An instance of
Reddit.
-
report(type)¶ Report the thread violating the Reddit rules.
Parameters: type – One of 'spam','vote-manipulation','personal-information','sexualizing-minors','site-breaking'.Usage:
thread = reddit.live('xyu8kmjvfrww') thread.report('spam')
-
updates(**generator_kwargs)¶ Return a
ListingGeneratoryieldsLiveUpdates.Parameters: generator_kwargs – keyword arguments passed to ListingGeneratorconstructor.Returns: A ListingGeneratorobject which yieldsLiveUpdateobject.Usage:
thread = reddit.live('ukaeu1ik4sw5') after = 'LiveUpdate_fefb3dae-7534-11e6-b259-0ef8c7233633' for submission in thread.updates(limit=5, params={'after': after}): print(submission.body)
-