Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.48 KB

reddit.rst

File metadata and controls

48 lines (30 loc) · 1.48 KB

Reddit

The connection to Reddit is based on the praw library.

Dependency

  • praw

Parameters

Required:

  • subreddit is the name of the subreddit from which the data is fetched.
  • clientId is the unique identifier issued to the client when creating credentials on Reddit. Refer to the [First Steps](https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example#first-steps) guide for more details on how to get this and the next two parameters.
  • clientSecret is the secret key obtained when credentials are created that is used for authentication and authorization.
  • userAgent is a string of your choosing that explains your use of the the Reddit API. More details are available in the guide linked above.

Optional:

Create Connection

CREATE DATABASE reddit_data WITH ENGINE = 'reddit', PARAMETERS = {
     "subreddit": "AskReddit",
     "client_id": "abcd",
     "clientSecret": "abcd1234",
     "userAgent": "Eva DB Staging Build"
};

Supported Tables

  • submissions: Lists top submissions in the given subreddit. Check databases/reddit/table_column_info.py for all the available columns in the table.
SELECT * FROM hackernews_data.search_results LIMIT 3;

Note

Looking for another table from Hackernews? Please raise a Feature Request.