Created
June 29, 2010 19:41
-
-
Save zpao/457704 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var latestTweetRequest = Request({ | |
url: "http://api.twitter.com/1/statuses/public_timeline.json", | |
onComplete: function () { | |
var tweet = this.response.json[0]; | |
console.log("User: " + tweet.user.screen_name); | |
console.log("Tweet: " + tweet.text); | |
} | |
}); | |
// Be a good consumer and check for rate limiting before doing more. | |
Request({ | |
url: "http://api.twitter.com/1/account/rate_limit_status.json", | |
onComplete: function () { | |
if (this.response.json.remaining_hits) { | |
latestTweetRequest.get(); | |
} else { | |
console.log("You have been rate limited!"); | |
} | |
} | |
}).get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment