<commit_before>const config = require('./config');
const Router = require('express').Router();
const request = require('request');
const Redis = require('ioredis');
const Moment = require('moment');
const MAIN_CALL = `https://cdn.contentful.com/spaces/${config.CONTENTFUL_SPACE_ID}/entries?access_token=${config.CONTENTFUL_API_TOKEN}`;
const ENTRIES_CALL = `${MAIN_CALL}&include=1&content_type=site&order=-fields.date`;
const ART_CALL = `${MAIN_CALL}&include=1&content_type=art&order=-fields.date`;
const SHOWS_CALL = `${MAIN_CALL}&include=1&content_type=show&order=-fields.date`;
const CATS_CALL = `${MAIN_CALL}&include=1&content_type=categories`;
const EXPIRATION = 60 * 60;
const mailgun = require('mailgun-js')({
  apiKey: config.MAILGUN_KEY,
  domain: config.MAILGUN_DOMAIN
})
let redis = new Redis({
  hostname: config.REDIS_HOST,
  port: config.REDIS_PORT,
  password: config.REDIS_PASS
});
let extractAssetsForEntries = function(items, assets) {
  // Return a formatted Data Object with necessary information.
  return items.map((item, index, array) => {
    let i = 0;
    let formattedItem = {
      link: item.fields.url,
      client: item.fields.client,
      agency: item.fields.agency,
      roles: item.fields.role,
      tech: item.fields.technology,
      isActive: item.fields.active,
      name: item.fields.name,
      date: Moment(item.fields.date, 'YYYY-MM-DD').format()
    }

    for(i; i < assets.length; i++) {
      // Check for the correct matching asset.
      if(assets[i].sys.id === item.fields.thumbnail.sys.id) {
        formattedItem['thumbnail'] = assets[i].fields.file.url;
        break;
      }
    }
<commit_msg>Update Redis API<commit_after>const config = require('./config');
const Router = require('express').Router();
const request = require('request');
const Redis = require('ioredis');
const Moment = require('moment');
const MAIN_CALL = `https://cdn.contentful.com/spaces/${config.CONTENTFUL_SPACE_ID}/entries?access_token=${config.CONTENTFUL_API_TOKEN}`;
const ENTRIES_CALL = `${MAIN_CALL}&include=1&content_type=site&order=-fields.date`;
const ART_CALL = `${MAIN_CALL}&include=1&content_type=art&order=-fields.date`;
const SHOWS_CALL = `${MAIN_CALL}&include=1&content_type=show&order=-fields.date`;
const CATS_CALL = `${MAIN_CALL}&include=1&content_type=categories`;
const EXPIRATION = 60 * 60;
const mailgun = require('mailgun-js')({
  apiKey: config.MAILGUN_KEY,
  domain: config.MAILGUN_DOMAIN
})
let redis = new Redis();
let extractAssetsForEntries = function(items, assets) {
  // Return a formatted Data Object with necessary information.
  return items.map((item, index, array) => {
    let i = 0;
    let formattedItem = {
      link: item.fields.url,
      client: item.fields.client,
      agency: item.fields.agency,
      roles: item.fields.role,
      tech: item.fields.technology,
      isActive: item.fields.active,
      name: item.fields.name,
      date: Moment(item.fields.date, 'YYYY-MM-DD').format()
    }

    for(i; i < assets.length; i++) {
      // Check for the correct matching asset.
      if(assets[i].sys.id === item.fields.thumbnail.sys.id) {
        formattedItem['thumbnail'] = assets[i].fields.file.url;
        break;
      }
    }

{'fraction_non_alphanumeric': 0.15298507462686567, 'fraction_numerical': 0.005597014925373134, 'mean_word_length': 4.230894308943089, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3235394', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1068, 'n_words': 204}