<commit_before>//jtwt.js by Harbor (http://jtwt.hrbor.com)

(function($){

 	$.fn.jtwt = function(options) { 

			//Declare defaults
			var defaults = {
				username : 'harbor',
				query: '',
                count : 4,
                image_size: 48,
                convert_links: true,
                loader_text: 'loading new tweets',
                no_result: 'No recent tweets found'
                
			}

			//Merge default with options
			var options =  $.extend(defaults, options);

			// customized parseTwitterDate. Base by http://stackoverflow.com/users/367154/brady - Special thanks to @mikloshenrich
			var parseTwitterDate = function(tdate) {
    
	    			var system_date = new Date(tdate.replace(/^\w+ (\w+) (\d+) ([\d:]+) \+0000 (\d+)$/, "$1 $2 $4 $3 UTC"));
	    			var user_date = new Date();
	
	    			var diff = Math.floor((user_date - system_date) / 1000);
	    			if (diff <= 1) {return "ahora";}
	    			if (diff < 20) {return "hace " + diff + " segundos";}
	    			if (diff < 40) {return "hace medio minuto";}
	    			if (diff < 60) {return "hace menos de un minuto";}
	    			if (diff <= 90) {return "hace un minuto";}
	    			if (diff <= 3540) {return "hace " + Math.round(diff / 60) + " minutos";}
	    			if (diff <= 5400) {return "hace una hora";}
	    			if (diff <= 86400) {return "hace " + Math.round(diff / 3600) + " horas";}
	    			if (diff <= 129600) {return "hace un día";}
	    			if (diff < 604800) {return "hace " + Math.round(diff / 86400) + " días";}
	    			if (diff <= 777600) {return "Hace una semana";}
	    			return "el " + system_date;
    
    		}
    		
    		return this.each(function() {
    		
				var o = options;
                var obj = $(this); 
                var q; 
                
				$(obj).append('<ul class="jtwt"></ul>');	
				$(".jtwt", obj).append('<li class="jtwt_loader jtwt_tweet" style="display:none;">' + o.loader_text + '</li>');	
				$(".jtwt_loader", obj).fadeIn('slow');
		
				//Check if there is a search query given, if not fetch user tweets
				if(o.query) {
					
					q = encodeURIComponent(o.query);
					
				} else {
					
					q = 'from:' + encodeURIComponent(o.username);
					
				}
		
				//get the tweets from the API
				$.getJSON('http://search.twitter.com/search.json?q=' + q + '&callback=?', function(data){ 

console.log(data);

					var results = data['results'];
					
					if(results.length) {
						
						//Loop through results and append them to the parent
						for(var i = 0; i < o.count && i < results.length; i++) {
						
							var item = results[i];
							
							jtweet = '<li class="jtwt_tweet">';
		
			                if (o.image_size) {
			                
			                	today = new Date();
			  
				                jtweet += '<div class="jtwt_picture">';
				                jtweet += '<a href="http://twitter.com/' + item.from_user + '">'
				                jtweet += '<img width="' + o.image_size +'" height="' + o.image_size + '" src="' + item.profile_image_url + '" />';
				                jtweet += '</a>';
				                jtweet += '</div>';
			
			                } <commit_msg>[tweets] - insecure content con jquery.jtwt para http://twitter.com/search...<commit_after>//jtwt.js by Harbor (http://jtwt.hrbor.com)

(function($){

 	$.fn.jtwt = function(options) { 

			//Declare defaults
			var defaults = {
				username : 'harbor',
				query: '',
                count : 4,
                image_size: 48,
                convert_links: true,
                loader_text: 'loading new tweets',
                no_result: 'No recent tweets found'
                
			}

			//Merge default with options
			var options =  $.extend(defaults, options);

			// customized parseTwitterDate. Base by http://stackoverflow.com/users/367154/brady - Special thanks to @mikloshenrich
			var parseTwitterDate = function(tdate) {
    
	    			var system_date = new Date(tdate.replace(/^\w+ (\w+) (\d+) ([\d:]+) \+0000 (\d+)$/, "$1 $2 $4 $3 UTC"));
	    			var user_date = new Date();
	
	    			var diff = Math.floor((user_date - system_date) / 1000);
	    			if (diff <= 1) {return "ahora";}
	    			if (diff < 20) {return "hace " + diff + " segundos";}
	    			if (diff < 40) {return "hace medio minuto";}
	    			if (diff < 60) {return "hace menos de un minuto";}
	    			if (diff <= 90) {return "hace un minuto";}
	    			if (diff <= 3540) {return "hace " + Math.round(diff / 60) + " minutos";}
	    			if (diff <= 5400) {return "hace una hora";}
	    			if (diff <= 86400) {return "hace " + Math.round(diff / 3600) + " horas";}
	    			if (diff <= 129600) {return "hace un día";}
	    			if (diff < 604800) {return "hace " + Math.round(diff / 86400) + " días";}
	    			if (diff <= 777600) {return "Hace una semana";}
	    			return "el " + system_date;
    
    		}
    		
    		return this.each(function() {
    		
				var o = options;
                var obj = $(this); 
                var q; 
                
				$(obj).append('<ul class="jtwt"></ul>');	
				$(".jtwt", obj).append('<li class="jtwt_loader jtwt_tweet" style="display:none;">' + o.loader_text + '</li>');	
				$(".jtwt_loader", obj).fadeIn('slow');
		
				//Check if there is a search query given, if not fetch user tweets
				if(o.query) {
					
					q = encodeURIComponent(o.query);
					
				} else {
					
					q = 'from:' + encodeURIComponent(o.username);
					
				}
		
				//get the tweets from the API
				$.getJSON('https://search.twitter.com/search.json?q=' + q + '&callback=?', function(data){ 

console.log(data);

					var results = data['results'];
					
					if(results.length) {
						
						//Loop through results and append them to the parent
						for(var i = 0; i < o.count && i < results.length; i++) {
						
							var item = results[i];
							
							jtweet = '<li class="jtwt_tweet">';
		
			                if (o.image_size) {
			                
			                	today = new Date();
			  
				                jtweet += '<div class="jtwt_picture">';
				                jtweet += '<a href="http://twitter.com/' + item.from_user + '">'
				                jtweet += '<img width="' + o.image_size +'" height="' + o.image_size + '" src="' + item.profile_image_url + '" />';
				                jtweet += '</a>';
				                jtweet += '</div>';
			
			                } 
{'fraction_non_alphanumeric': 0.16426193118756938, 'fraction_numerical': 0.02314888219438719, 'mean_word_length': 1.797339246119734, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 23, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '919829', 'n_tokens_mistral': 2672, 'n_tokens_neox': 2058, 'n_words': 522}