I used the following widget that does not work anymore. It displays the latest tweet from chosen twitter accounts in turn. I have consumer key, secret and access token but don't know how to add it to make the widget work.
<script><!--
var feed = ["david_garrett", "50cent", "shemarmoore"];
var refresh = 20;
var direction = 0;
window.onload = function()
{
var scriptTag = document.createElement("script");
var location = (feed.constructor == Array) ? feed[Math.floor(Math.random() * feed.length)] : feed;
scriptTag.setAttribute("src", "https://api.twitter.com/1/statuses/user_timeline/" + location + ".json?callback=retrieveData&count=1×tamp=no");
document.getElementsByTagName("body")[0].appendChild(scriptTag);
setTimeout("location.reload();", refresh * 1000);
}
function retrieveData(twitters)
{
var tweet = document.getElementById("u");
tweet.innerHTML = "<span><b>" + twitters[0].user.screen_name + "</b><br/>" + twitters[0].text + "</span>";
if (tweet.scrollHeight > tweet.clientHeight)
setTimeout(scrollWindow, 5000);
}
function scrollWindow()
{
var tweet = document.getElementById("u");
if (direction == 0)
tweet.scrollTop++;
else
tweet.scrollTop--;
if (tweet.scrollTop + tweet.clientHeight >= tweet.scrollHeight)
{
direction = 1;
setTimeout(scrollWindow, 5000);
}
else if (tweet.scrollTop <= 0)
{
direction = 0;
setTimeout(scrollWindow, 5000);
}
else
{
setTimeout(scrollWindow, 100);
}
}
//-->
</script>