Add the following to the index.html (Replace “chyneyee” with your Twitter username):
<script src="https://api.twitter.com/1/statuses/user_timeline/chyneyee.json?callback=updateTweets"></script>
Add the following code to the js file:
// tweets passed a response containing the tweets from the user timeline as an array of tweets.
function updateTweets(tweets) {
var tweetsSelection=document.getElementById("tweets"); // grab a reference to the tweets selection from the form.
for (var i=0;i<tweets.length;i++) {
tweet = tweets[i]; // get a tweet from the array
var option=document.createElement("option"); // Create a new option element
option.text=tweet.text; // Set its text to the tweet
option.value=tweet.text.replace("\"","'"); // replace double quotes with single quotes
tweetsSelection.options.add(option);
}
tweetsSelection.selectedIndex=0;
}













