🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

reddit-api-generator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-api-generator

Converts Reddit's API into structured formats

3.0.0
latest
Source
npm
Version published
Weekly downloads
2
-88.24%
Maintainers
1
Weekly downloads
 
Created
Source

reddit-api-generator

Transforms the auto generated Reddit API into structured formats for consumption by anyone looking to write a wrapper for the Reddit API.

The dist folder contains the various outputs that can be consumed.

Data Format

The data format is a flat array of endpoints.

Every endpoint has enough data with it to create a call to the Reddit API. Here is a sample of one endpoint [/r/subreddit]/new:

[
    {
        "path": "/r/$subreddit/new",
        "url": {
            "oauth": "https://oauth.reddit.com/r/$subreddit/new",
            "standard": "http://www.reddit.com/r/$subreddit/new"
        },
        "oauth": [
            "read"
        ],
        "extensions": [
            ".json",
            ".xml"
        ],
        "method": "GET",
        "describe": "This endpoint is a listing.",
        "args": {
            "after": {
                "describe": "fullname of a thing"
            },
            "before": {
                "describe": "fullname of a thing"
            },
            "count": {
                "describe": "a positive integer (default: 0)"
            },
            "limit": {
                "describe": "the maximum number of items desired (default: 25, maximum: 100)"
            },
            "show": {
                "describe": "(optional) the string all"
            }
        }
    },
    {/* another endpoint */},
    {/* and another... */}
]

Url parameters

Sometimes there are parameters in the url. These are represented with a "$" prepending the name of the variable. Given this path, the path in the endpoint will look like:

/api/multi/$multipath/r/$srname

Install

Without a package manager

Pull out the files you need from the dist folder.

npm

npm install reddit-api-generator

bower

bower install reddit-api-generator

Usage

JSON

Raw JSON can be used in any language.

Node.js

var redditApi = require('reddit-api-generator');

AMD

requirejs(['reddit-api-generator'], function(redditApi) {

});

Test

npm test

Building

Run the command bin/buildAll.sh

Keywords

reddit

FAQs

Package last updated on 27 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts