Skip to content

Instantly share code, notes, and snippets.

@vicapow
Created October 10, 2013 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicapow/6927392 to your computer and use it in GitHub Desktop.
Save vicapow/6927392 to your computer and use it in GitHub Desktop.
// reddit authentication with oauth 2.0
var request = require('request');
var token = 'XXXXXXXXXXXXXXXXXXXXXXXXX';
request.post({
url: 'https://oauth.reddit.com/api/submit',
body: body,
json: true,
headers: { Authorization: "Bearer " + token + ", scope=submit" } // dont forget scope!!
}, function(err, response, body){
console.log(err, body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment