<commit_before>function BonomoController() {
	
	var FacebookController = require('FacebookController');
	var fbController = new FacebookController();
	var model = require('/model/Model');
	var foursquareClient = 'BEAN1M5YGO4MLJ0LOHURGTJW5YA3IBYMGD1FGCUBW50NX322';
	var foursquareSecret = '<KEY>';
	
	
	var SERVER_URL = "http://bonomo.herokuapp.com/";
	
	/**
	 * 
	 */
	this.createBoredomCheckin = function(checkin, callback) {
		
		var post = {};
		post.checkin = {};
		post.checkin = checkin;
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onerror = function(e) {
	         Ti.API.debug(e.error);
	    };
		xhr.onload = function() {
			callback();
		}
		xhr.open("POST", SERVER_URL + "checkins/create_with_user/" + Titanium.Facebook.getUid() +".json");
		xhr.setRequestHeader("Content-Type","application/json; charset=utf-8");
		xhr.send(JSON.stringify(post));
	}
	
	/**
	 * 
	 */
	this.synchronizeFB = function(callback) {
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onerror = function(e) {
	         Ti.API.debug(e.error);
	    };
		xhr.onload = function() {
			var result = JSON.parse(this.responseText);
			model.setUsuarioRuby(result);
			callback();
		}
		xhr.open("GET", SERVER_URL + "users/facebook_synch/" + Titanium.Facebook.getUid() + ".json?token=" + Titanium.Facebook.getAccessToken());
		xhr.send();
	}
	
	/**
	 * 
	 */
	this.getPlaces = function(checkin, callback) {
		
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onload = function() {
			places = [];
			var data = JSON.parse(this.responseText);
			var foursquareData = JSON.parse(this.responseText).response.venues;
			for (var index in foursquareData) {
				var cat = [];
				for (var catIdx in foursquareData[index].categories) {
					cat.push(foursquareData[index].categories[catIdx]);
				}
				places.push({
					"title": foursquareData[index].name,
					"color": "#000000", 
					"distancia": foursquareData[index].location.distance, 
					"categoria": cat[0].name,
					"imagen": cat[0].icon.prefix + '44.png',
					"longitude": foursquareData[index].location.lng,
					"latitude": foursquareData[index].location.lat,
					// NECESARIOS PARA EL SERVICIO
					"location": {
						"lng": foursquareData[index].location.lng,
						"lat": foursquareData[index].location.lat
					},
					"name": foursquareData[index].name,
					"id": foursquareData[index].id,
					"categories":[{
						"name": cat[0].name,
						"id": cat[0].id
					}]
				});<commit_msg>Se arreglo lo del arreglo<commit_after>function BonomoController() {
	
	var FacebookController = require('FacebookController');
	var fbController = new FacebookController();
	var model = require('/model/Model');
	var foursquareClient = 'BEAN1M5YGO4MLJ0LOHURGTJW5YA3IBYMGD1FGCUBW50NX322';
	var foursquareSecret = '<KEY>';
	
	
	var SERVER_URL = "http://bonomo.herokuapp.com/";
	
	/**
	 * 
	 */
	this.createBoredomCheckin = function(checkin, callback) {
		
		var post = {};
		post.checkin = {};
		post.checkin = checkin;
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onerror = function(e) {
	         Ti.API.debug(e.error);
	    };
		xhr.onload = function() {
			callback();
		}
		xhr.open("POST", SERVER_URL + "checkins/create_with_user/" + Titanium.Facebook.getUid() +".json");
		xhr.setRequestHeader("Content-Type","application/json; charset=utf-8");
		xhr.send(JSON.stringify(post));
	}
	
	/**
	 * 
	 */
	this.synchronizeFB = function(callback) {
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onerror = function(e) {
	         Ti.API.debug(e.error);
	    };
		xhr.onload = function() {
			var result = JSON.parse(this.responseText);
			model.setUsuarioRuby(result);
			callback();
		}
		xhr.open("GET", SERVER_URL + "users/facebook_synch/" + Titanium.Facebook.getUid() + ".json?token=" + Titanium.Facebook.getAccessToken());
		xhr.send();
	}
	
	/**
	 * 
	 */
	this.getPlaces = function(checkin, callback) {
		
		var xhr = Titanium.Network.createHTTPClient();
		xhr.onload = function() {
			places = [];
			var data = JSON.parse(this.responseText);
			var foursquareData = JSON.parse(this.responseText).response.venues;
			var cat = '';
			var img = '';
			var id = '';
			for (var index in foursquareData) {
				for (var catIdx in foursquareData[index].categories) {
					if (catIdx == 0 || catIdx == '0') {
						cat = foursquareData[index].categories[catIdx].name;
						id = foursquareData[index].categories[catIdx].id;
						img = foursquareData[index].categories[catIdx].icon.prefix + '44.png';
					}
				}
				places.push({
					"title": foursquareData[index].name,
					"color": "#000000", 
					"distancia": foursquareData[index].location.distance, 
					"categoria": cat,
					"imagen": img,
					"longitude": foursquareData[index].location.lng,
					"latitude": foursquareData[index].location.lat,
					// NECESARIOS PARA EL SERVICIO
					"location": {
						"lng": foursquareData[index].location.lng,
						"lat": foursquareData[index].location.lat
					},
					"name": foursquareData[index].name,
					"id": foursquareData[index].id,
					"categories":[{
						"name": cat,
						"id": id
					}]
				});
{'fraction_non_alphanumeric': 0.1635257165292501, 'fraction_numerical': 0.009422850412249705, 'mean_word_length': 3.434290687554395, 'pattern_counts': {'":': 30, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3003077', 'n_tokens_mistral': 2171, 'n_tokens_neox': 1742, 'n_words': 278}