<commit_before>var React = require("react");
var Appbase = require("appbase-js");
var config = {
  "appname": "jsfiddle-demo",
  "username": "7eJWHfD4P",
  "password": "<PASSWORD>",
  "type": "1463991450935"
};

var appbaseRef = new Appbase({
  url: 'https://scalr.api.appbase.io',
  appname: config.appname,
  username: config.username,
  password: <PASSWORD>
});
var requestObject = {
  type: config.type,
  body: {
    query: {
      match_all: {}
    }
  }
};


var Stats = React.createClass({

  getInitialState: function(){
    var self = this;

    appbaseRef.searchStream(requestObject).on('data', function(stream) {
      self.setState({bid: stream._source.bid});
      self.setState({last: stream._source.last});
      self.setState({avg: stream._source['24h_avg']});
      self.setState({total: stream._source.total_vol});
      self.setState({ask: stream._source.ask});


      console.log(stream._source.last);

    }).on('error', function(error) {
      console.log('Error handling code');
    });

    return {
      bid: "0",
      last: "0",
      avg: "0",
      total: "0",
      ask: "0"
    };
  },

  componentDidMount: function(){

    setInterval(function(){

    },1000);
  },
  render : function(){

    return (
      <div>
      <div className="bid-center">
      <p className="label-text">BID</p>
      </div>
      <center><div id="odometer" className="odometer odometer-theme-digital">{this.state.bid}
      </div></center>

      <div className="col-md-6">
      <p className="label-text">LAST</p>
      <p className="val" id="avg">{this.state.last}</p>
      </div>
      <div className="col-md-6">
      <p className="label-text">AVG OF 24 HRS</p>
      <p className="val" id="avg">{this.state.avg}</p>
      </div>
      <div className="col-md-6">
      <p className="label-text">TOTAL</p>
      <p className="val" id="avg">{this.state.total}</p>
      </div>
      <div className="col-md-6">
      <p className="label-text">ASK</p>
      <p className="val" id="avg">{this.state.ask}</p>
      </div>
      </div>
    )
  }
});
module.exports = Stats;<commit_msg>changed Stats file<commit_after>var React = require("react");
var Appbase = require("appbase-js");
var appbaseRef = require("../appbase").appbaseRef;
var requestObject = {
  type: config.type,
  body: {
    query: {
      match_all: {}
    }
  }
};

var Stats = React.createClass({

  getInitialState: function(){
    var self = this;

    appbaseRef.searchStream(requestObject).on('data', function(stream) {
      self.setState({bid: stream._source.bid});
      self.setState({last: stream._source.last});
      self.setState({avg: stream._source['24h_avg']});
      self.setState({total: stream._source.total_vol});
      self.setState({ask: stream._source.ask});
    }).on('error', function(error) {
      console.log('Error handling code');
    });
    return {
      bid: "0",
      last: "0",
      avg: "0",
      total: "0",
      ask: "0"
    };
  },
  render : function(){

    return (
      <div>
        <div className="bid-center">
          <p className="label-text">BID</p>
          </div>
          <center>
            <div id="odometer" className="odometer odometer-theme-digital">{this.state.bid}
            </div>
          </center>
          <div className="col-md-6">
            <p className="label-text">LAST</p>
            <p className="val" id="avg">{this.state.last}</p>
          </div>
          <div className="col-md-6">
            <p className="label-text">AVG OF 24 HRS</p>
            <p className="val" id="avg">{this.state.avg}</p>
          </div>
          <div className="col-md-6">
            <p className="label-text">TOTAL</p>
            <p className="val" id="avg">{this.state.total}</p>
          </div>
          <div className="col-md-6">
            <p className="label-text">ASK</p>
            <p className="val" id="avg">{this.state.ask}</p>
          </div>
      </div>
    )
  }
});
module.exports = Stats;
{'fraction_non_alphanumeric': 0.19192938209331653, 'fraction_numerical': 0.011349306431273645, 'mean_word_length': 2.4881266490765173, 'pattern_counts': {'":': 4, '<': 73, '<?xml version=': 0, '>': 73, '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': '4020385', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1327, 'n_words': 235}