Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created March 12, 2010 20:41
Show Gist options
  • Save deadprogram/330771 to your computer and use it in GitHub Desktop.
Save deadprogram/330771 to your computer and use it in GitHub Desktop.
button.addEventListener('click', function()
{
var xhr = Titanium.Network.createHTTPClient();
xhr.onerror = function(e)
{
alert("ERROR " + e.error)
}
xhr.onload = function()
{
label.hide();
var resp = eval('('+this.responseText+')');
for (var i=0;i<resp.length;i++)
{
status.text += resp[i].user.name + '\n' + resp[i].text + '\n\n';
}
scrollView.add(status);
};
// open the client
xhr.open('GET','http://'+username.value+':'+password.value+'@twitter.com/statuses/friends_timeline.json?count=5');
// send the data
xhr.send();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment