Instantly share code, notes, and snippets.

What would you like to do?
Updated code snippet for a Scripting News blog post, with corrected code
//Goes with this blog post --
var params = {
url: "",
oauth: {
consumer_key: process.env.twitterConsumerKey,
consumer_secret: process.env.twitterConsumerSecret,
token: parsedUrl.query.oauth_token,
token_secret: parsedUrl.query.oauth_token_secret
function requestCallback (error, response, body) {
if (error) {
errorResponse (error);
else {
dataResponse (body);
var r = (params, requestCallback);
var form = r.form ();
var buffer = new Buffer (body, "base64");
form.append ("status", parsedUrl.query.status);
form.append ("media[]", buffer, {filename: "picture.png");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment