LiveThreadStream¶
- class praw.models.reddit.live.LiveThreadStream(live_thread)¶
Provides a
LiveThreadstream.Usually used via:
for live_update in reddit.live("ta535s1hq2je").stream.updates(): print(live_update.body)
- Parameters:
live_thread (models.LiveThread)
- __init__(live_thread)¶
Initialize a
LiveThreadStreaminstance.- Parameters:
live_thread (
LiveThread) – The live thread associated with the stream.- Return type:
None
- updates(**stream_options)¶
Yield new updates to the live thread as they become available.
- Parameters:
- Return type:
As with
LiveThread.updates(), updates are yielded asLiveUpdate.Updates are yielded oldest first. Up to 100 historical updates will initially be returned.
Keyword arguments are passed to
stream_generator().For example, to retrieve all new updates made to the
"ta535s1hq2je"live thread, try:for live_update in reddit.live("ta535s1hq2je").stream.updates(): print(live_update.body)
To only retrieve new updates starting from when the stream is created, pass
skip_existing=True:live_thread = reddit.live("ta535s1hq2je") for live_update in live_thread.stream.updates(skip_existing=True): print(live_update.author)