Skip to content

Nodewhal is a Node.js reddit API wrapper that relies heavily on RSVP promises

License

Notifications You must be signed in to change notification settings

go1dfish/nodewhal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodewhal

Node.js reddit API wrapper that relies heavily on RSVP promises

Usage

var Nodewhal = require('nodewhal');

Nodewhal('my-cool-user-agent').login('kn0thing', 'hunter2').then(function(kn0thing) {
  return kn0thing.listing(session, '/r/POLITIC/new').then(function(posts) {
    return kn0thing.submit('POLITIC', 'link',
      "The Downing Street Memo",
      "http://www.downingstreetmemo.com"
    ).then(function(submission) {
      return kn0thing.flair('POLITIC', submission.name ,
        'flairclass', 'First Post!'
      ).then(function() {return submission;});
    });
  });
}).then(function(newSubmission) {
  console.log("Posted to", newSubmission.url, "with flair");
}, function(error) {
  console.error("There was a problem", error);
});

About

Nodewhal is a Node.js reddit API wrapper that relies heavily on RSVP promises

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages