Skip to content

Instantly share code, notes, and snippets.

@snaka
Created September 18, 2008 05:49
Show Gist options
  • Save snaka/11383 to your computer and use it in GitHub Desktop.
Save snaka/11383 to your computer and use it in GitHub Desktop.
/**
* Twitter をチラ見 (Simplest twitter reader)
*/
CmdUtils.CreateCommand({
name: "tirami-twitter",
preview: function(pblock){
jQuery.get("http://twitter.com/statuses/friends_timeline.json", {count:15}, function(data){
var messages = [];
messages.push("<div style='font-size:0.7em'>");
for( var i = 0; i < data.length; i++) {
messages.push(
'<img src="' + data[i].user.profile_image_url + '" style="width:1.5em;"/>' +
'<b>&raquo;' +
data[i].user.screen_name +
'</b>:&nbsp;' +
data[i].text);
}
messages.push("</div>");
pblock.innerHTML = messages.join('<br/>');
},"json");
},
execute: function(){/* DO NOTHING */}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment