<commit_before>var _ = require('underscore');

Parse.Cloud.job("updateChampions", function(request, status) {
  var RIOT_API_KEY;
  var beginDate = Date.now()/1000 - 3600; // 1 hour ago
  beginDate -= beginDate%300; // floored to 5 minute increment

  Parse.Config.get().then(function(config){
    RIOT_API_KEY = config.get('RIOT_API_KEY')
    return RIOT_API_KEY;
  }).then(function(){
    return Parse.Cloud.httpRequest({
      url: 'https://na.api.pvp.net/api/lol/na/v4.1/game/ids',
      params: {
        api_key: RIOT_API_KEY,
        beginDate: beginDate
      }
    })
  }).then(function(response){
    var matchIds = _.first(response.data, 9); // make sure we don't go over our rate-limit
    var promises = [];
    _.each(matchIds, function(matchId){
      promises.push(Parse.Cloud.httpRequest({
          url: 'https://na.api.pvp.net/api/lol/na/v2.2/match/'+matchId,<commit_msg>Keep track of number of matches returned from endpoint<commit_after>var _ = require('underscore');

Parse.Cloud.job("updateChampions", function(request, status) {
  var RIOT_API_KEY;
  var beginDate = Date.now()/1000 - 3600; // 1 hour ago
  beginDate -= beginDate%300; // floored to 5 minute increment

  Parse.Config.get().then(function(config){
    RIOT_API_KEY = config.get('RIOT_API_KEY')
    return RIOT_API_KEY;
  }).then(function(){
    return Parse.Cloud.httpRequest({
      url: 'https://na.api.pvp.net/api/lol/na/v4.1/game/ids',
      params: {
        api_key: RIOT_API_KEY,
        beginDate: beginDate
      }
    })
  }).then(function(response){
    console.log("Found: " + response.data.length + " matches @ " + beginDate);

    var matchIds = _.first(response.data, 9); // make sure we don't go over our rate-limit
    var promises = [];
    _.each(matchIds, function(matchId){
      promises.push(Parse.Cloud.httpRequest({
          url: 'https://na.api.pvp.net/api/lol/na/v2.2/match/'+matchId,
{'fraction_non_alphanumeric': 0.15412940557601262, 'fraction_numerical': 0.01893740136770121, 'mean_word_length': 3.1710526315789473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2040221', 'n_tokens_mistral': 686, 'n_tokens_neox': 650, 'n_words': 123}