﻿$(document).ready(function () {
    var url = "http://twitter.com/status/user_timeline/ccmmagazine.json?count=3&callback=?";
    $.getJSON(url, function (data) {
        $.each(data, function (i, item) {
            //$("#twtr-profileimg").attr("src", item.user["profile_image_url"]);
            $("#twtr-temp").remove();
            $("#twtr-tweets").append("<div class=\"twtr-tweet twtr-tweetborder\" >"
                                + item.text.linkify() + "</div>");
        });
        $(".twtr-tweetborder:last").removeClass("twtr-tweetborder");

    });
});

String.prototype.linkify = function () {
    return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function (m) {
        return m.link(m);
    });
};

function twitter_callback ()
{
	return true;
}

