I got it working. In case anyone else wants to know, I’ll post the code here. You need the “jquery.js” file saved in whatever directory the html file containing this script is in. To make the jquery.js file go here. Open the link that says “Download the compressed…” It will take you to a huge wall of text. Copy it and paste it into a new text document. Save that text document as “jquery.js” and you are done. The code:
<script src="jquery.js"></script>
<script>
window.setInterval("reloadFrame();", 15000);
function reloadFrame() {
for (var i=1;i<=[number of badges];i++){
var nm = 'frame' + i;
var ur = document.getElementById(nm).attributes[4].nodeValue;
ur = ur.split("/");
ur = ur[ur.length-2];
ur = 'https://api.twitch.tv/kraken/streams/' + ur;
var wt = document.getElementById(nm).style.width;
showhide(nm,ur,wt);
}
}
function showhide(nm,ur,wt){
$.ajax({
url: ur,
dataType: 'jsonp',
type: 'get',
success: function(data) {
if(data.stream === null) {
if(wt=="160px")
document.getElementById(nm).style.width = '0px';
} else {
if(wt != "160px"){
document.getElementById(nm).style.width = '160px';
document.getElementById(nm).src += '';
}
}
},
});
}
</script>
<center><iframe id="frame1" src="http://streambadge.com/twitch/custom/2B2B2B/FFBF00/FFBF00/normalice/" style="border:none" scrolling="no" height="52px" width="0px"></iframe><iframe>....additional frames here...
<script>reloadFrame();</script>
</center>