var cache ={
	tweetData: ''
};
function tweetData(screen_name, selector, property){
	if (cache.tweetData.screen_name){
		selector.hide().html(cache.tweetData.screen_name[property]).fadeIn('fast');
	}else{
		// Enable caching
		$.ajaxSetup({ cache: true });
		// Send JSON request
		// The returned JSON object will have a property called "results" where we find
		// a list of the tweets matching our request query
		$.getJSON('https://api.twitter.com/1/users/show.json?callback=?&screen_name='+screen_name,
			function(data) {
				selector.hide().html(data[property]).fadeIn('fast');
				cache.tweetData.screen_name = data;
			}
		);
	}
}
function tweetsCorunet(){
	$.getJSON('https://api.twitter.com/1/statuses/user_timeline.json?callback=?&include_entities=true&include_rts=true&screen_name=corunet&count=5',
			function(data) {
				//console.log(data)
				$.each(data ,function(index, tweet){
					tweet.text.replace(new RegExp( 'http([s]?):\/\/([^\ \)$]*)', 'gi'), 'LINK');
				//console.log(tweet);
					$('#twitter ul').append('<li><span class="texto">'+tweet.text+'</span><span class="cuando">'+tweet.created_at+'</span></li>')
				});
			}
		);
	
}
