JSFiddle - React, Tailwind, and code Playground

by namuol

CSS

ul {
    width: 200px;
    float: left;
    margin: 5px;
}
body {
    font-family: Verdana;
    font-size: 10pt;
}

JavaScript

var ids = [
    2357536,
    2487796,
    2424766,
    2391279,
    2442047,
    2471390,
    23424900,
    2487889,
    2475687,
    9807,
    2379574
];

var i;

for (i = 0; i < ids.length; ++i) {
    $.ajax({
        url: "http://api.twitter.com/1/trends/" + ids[i] + ".json",
        dataType: "jsonp",
        cache: true,
        success: function(res) {
            var trends = res[0].trends,
                name = res[0].locations[0].name,
                el = $('<ul><li><b>'+name+'</b></li></ul>');
            
            for (var i = 0; i < trends.length; ++i) {
                el.append($('<li>'+trends[i].name+'</li>'));
            }
            $('body').append(el.fadeIn(250));
        }
    });
}