Skip to content

empyrical/snoode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snoode

Someday, it will be a reddit API library.

For now, it handles only a few resources. Building in parallel with switcharoo.

// Convert snoode's es6 to es5. To use in browser, use babelify and
// compile in.

require('babel/register')({
  ignore: false,
  only: /.+(?:(?:\.es6\.js)|(?:.jsx))$/,
  extensions: ['.js', '.es6.js'],
  sourceMap: true,
});

// Require snoode.
var api = require('snoode').v1;

// Example call to get links for /r/homebrewing.
api.links.get({
  subredditName: 'homebrewing',
  view: 'hot'
}).then(function(listings) {
  // do stuff with the array of listings
});

// Example call to get all comments for this particular listing.
api.comments.get({
  linkId: 't3_ib4bk'
}).then(function(comments, listing) {
  // do stuff with the array of comments
});

Caveats

  • Requires iojs, or node with --harmony flag.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%