Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

javascript tweet status update

javascript tweet status update


Ok so I thought I would find the answer I was looking for with a search but maybe I'm just not understanding things, so here goes.

I want to run Status updates to my twitter account using javascript only my code runs on top of node.js so there is no html or php strictly javascript. So a text box is out php is out.

I've searched around and can't seem to find a solid example where I can just post using ajax or something to update my status can someone please point me in the right direction ?

Problem courtesy of: mcgrailm


Have a look at Mikeal's Request module. You can send a POST request as follows:

var request = require('request');{
  url: '',
  headers: {
    'Content-Type': 'application/json'
  body: JSON.stringify({
    status: "Your new Twitter status"
}, function(error, response, body){

Note that this example is not complete as you would still have to authenticate to Twitter.

Solution courtesy of: Phil Klein


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

javascript tweet status update


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription