Skip to content

A Server Side Event stream to deliver Reddit comments and submissions in near real-time to a client.

License

Notifications You must be signed in to change notification settings

pushshift/reddit_sse_stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Reddit SSE Stream

What is this?

This is an SSE stream that you can connect to using a browser or other programs to get a live feed of near real-time Reddit data (couple seconds delayed).

There is a caveat however -- SSE streams currently only work via http (no SSL). However, it does support compression! I highly encourage you to connect using compression headers to conserve bandwidth if you use the full feed.

curl --verbose --compressed 'http://stream.pushshift.io/?type=comments'

Parameters Supported

Parameter Description Possible Values
type Restrict feed to a particular event type. Leave out to receive all event types. comments,submissions
author Restrict to certain authors. Separate multiple authors with a comma. String
submission Restrict to certain subreddits. Separate multiple subreddits with a comma. String

Examples:

Get only submissions from news and politics:

curl --verbose --compressed 'http://stream.pushshift.io/?type=submissions&subreddit=politics,news'

Get only comments from automoderator:

curl --verbose --compressed 'http://stream.pushshift.io/?type=comments&author=automoderator'

Notice: When connecting with compression. It generally takes a little bit of time before it gets started. Also, only one connection per IP is supported. If you need additional streams, please contact me.

Event Types:

Event Description Currently Implemented
rc A new Reddit comment in json format Yes
rs A new Reddit submission in json format Yes
rr A new Reddit subreddit in json format No
keepalive A keepalive message (every 30 seconds) Yes

Keepalive Messages:

Currently, a keepalive event is sent to the client every 30 seconds regardless if previous data was sent. The keepalive event has the following information:

Key Value Description
tcs Total Comments Sent
tss Total Submissions Sent
tbs Total bytes sent (uncompressed)

About

A Server Side Event stream to deliver Reddit comments and submissions in near real-time to a client.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages