{"size": 687, "ext": "js", "max_stars_repo_path": "backend/server.js", "max_stars_repo_name": "mcdonamp/sanichat", "max_stars_repo_stars_event_min_datetime": "2015-05-15T18:42:50.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-07T15:36:07.000Z", "max_issues_repo_path": "backend/server.js", "max_issues_repo_name": "asciimike/sanichat", "max_issues_repo_issues_event_min_datetime": "2015-06-01T10:19:23.000Z", "max_issues_repo_issues_event_max_datetime": "2016-06-22T18:11:19.000Z", "max_forks_repo_path": "backend/server.js", "max_forks_repo_name": "asciimike/sanichat", "max_forks_repo_forks_event_min_datetime": "2015-06-01T16:21:07.000Z", "max_forks_repo_forks_event_max_datetime": "2017-07-06T21:23:42.000Z"}
{"max_stars_count": 43, "max_issues_count": 4, "max_forks_count": 17, "avg_line_length": 28.625, "max_line_length": 73, "alphanum_fraction": 0.6288209607}
var Queue = require('firebase-queue'),
    Firebase = require('firebase'),
    Filter = require('bad-words');

var filter = new Filter();
var ref = new Firebase('https://sanichat.firebaseio.com/');
ref.authWithCustomToken('<your-token-here>', function(err, authData){
    if (err) {
      console.log("Login failed with error: ", err);
    } else {
      console.log("Authenticated successfully with payload: ", authData);
    }
});
var queue = new Queue(ref, function(data, progress, resolve, reject) {
  data.message = filter.clean(data.message);
  ref.child('messages').push(data, function(err){
    if (err) {
        reject(err);
    } else {
        resolve(data);
    }
  });
});
