Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A bit of server code, referenced in a blog post on Scripting News
//see this blog post for background --
var buffer = new Buffer (body, "base64");
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 (response);
var r = (params, requestCallback);
var form = r.form ();
form.append ("status", parsedUrl.status);
form.append ("media[]", buffer); //I believe this is where the problem lies! DW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment