redd
redd copied to clipboard
Add ability to stream messages.
trafficstars
Requested in https://redd.it/76rrw4.
Is it possible to stream comment replies? e.g.:
session.my_messages(:category=>'comments').stream { |comment| .. }Thanks in advance.
EDIT: It looks like PRAW supports it (see here). I wonder if it would be possible to duplicate this functionality in Redd.
Reply by OP (for keeping track):
This seems to be working. Let me know if I'm on the right track!
options = { :category=>'unread' }.freeze Redd::Models::PaginatedListing.new(SESSION.client, options) do |**req_options| SESSION.my_messages(options.merge(req_options)) end.stream do |comment| next unless comment.instance_of?(Redd::Models::Comment) # .. end