This package has been deprecated

Author message:

@WARNING: @WARNING: @WARNING: THIS PACKAGE IS NO LONGER MAINTAINED! Please consider using another package.

snooform

0.1.1 • Public • Published

snooform

Transforms the Reddit API into various structured formats. Useful for anyone looking to write an API Wrapper for Reddit.

Output Formats

  • json
  • Node.js
  • AMD
  • ... that's it for now. open an issue / pull request for more

Install

npm

npm install -g snooform

Usage

Command Line

Take a look at the man pages, or the --help flag for more information

man snooform
snooform -h

Node module

var build = require('snooform');
 
var options = {}; // customize the output
 
build.jsonApi(options).done(function(output) {
  console.log(output);
});

Data Format (JSON example)

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

Test

npm test

Package Sidebar

Install

npm i snooform

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • akm8ihc78quzbfy
  • 7fs9jsaipnxzg2agkaegqgnbappcpw