{"size": 725, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "jzeiders/CitySentiments", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "jzeiders/CitySentiments", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server.js", "max_forks_repo_name": "jzeiders/CitySentiments", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.0, "max_line_length": 46, "alphanum_fraction": 0.6537931034}
var express = require("express");
var request = require("request");
var Promise = require("promise");
var twitter = require("./helpers/twitter.js");
var db = require("./helpers/db.js");
var fileGen = require("./helpers/fileGen.js");
var app = express();


// twitter.get()
// twitter.getCityTweets("LA","Boston")
// fileGen.uploadCitiesJson();
// db.scoreJob();

app.get("/scores", function(req,res){
  db.getScores().then(function(data){
    res.send(data);
  }).catch(function(err) {
    res.send("Server Side Error");
  	console.log("FUCKING ERROR: ", err);
  });
});
app.set('port', (process.env.PORT || 5000));

app.listen(app.get('port'), function() {
  twitter.dataCollectionJob();
	console.log("started server");
});
