Skip to content

Instantly share code, notes, and snippets.

@zuzu
Created September 18, 2009 13:09
Show Gist options
  • Save zuzu/189042 to your computer and use it in GitHub Desktop.
Save zuzu/189042 to your computer and use it in GitHub Desktop.
(function(){
var xmlhttp = (function(){
try{ return new ActiveXObject('Msxml2.XMLHTTP'); }
catch(e){
try{ return new ActiveXObject('Microsoft.XMLHTTP'); }
catch(ee){ return null; }
}
})();
if(!xmlhttp) return;
var args = WScript.Arguments;
if(args.length < 3) return;
var statuses = [];
for(var i = 2; i < args.length; i++){
statuses.push(args.Item(i));
}
//半角セミコロン・半角空白の追記をしないように変更
xmlhttp.open('POST', 'http://twitter.com/statuses/update.json', false, args.Item(0), args.Item(1));
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.setRequestHeader('X-Twitter-Client', 'TwitterClient.js by muumoo.jp');
xmlhttp.setRequestHeader('X-Twitter-Client-Version', '0.1');
xmlhttp.setRequestHeader('X-Twitter-Client-URL', 'http://muumoo.jp/download/data/twitterclient.js.xml');
xmlhttp.send('status=' + encodeURIComponent(statuses.join('')));
if(xmlhttp.status != 200) WScript.echo(xmlhttp.status + ' ' + xmlhttp.statusText);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment