3.0.0 • Published 9 years ago

reddit-api-generator v3.0.0

Weekly downloads
22
License
MIT
Repository
github
Last release
9 years ago

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

3.0.0

9 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago