<commit_before>'use strict';

let stage = 'dev';
let bucket = 'www-dev.404.md';

if (process.argv[3] === 'master') {
  stage = 'master';
  bucket = 'www.404.md'
}

module.exports = {
  service: 'www-404-md',
  custom: {
    bucket: bucket,
    schedule: 'rate(1 day)'
  },
  provider: {
    name: 'aws',
    runtime: 'nodejs8.10',
    stage: stage,
    region: 'eu-central-1',
    environment: {
      BUCKET_NAME: '${self:custom.bucket}'
    },
    role: 'arn:aws:iam::492198229272:role/ServiceRoleForLambdaEdge'
  },
  package: {
    individually: true,
    exclude: ['./**'],
    include: ['common/**']
  },
  functions: {
    'medium-feed': {
      handler: 'medium-feed/index.handler',
      package: {
        include: ['medium-feed/**']
      },
      environment: {
        COUNT: '3',
        MAX_WIDTH: '590',
        KEY_NAME: 'json/medium-feed.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'instagram-feed': {
      handler: 'instagram-feed/index.handler',
      package: {
        include: ["instagram-feed/**"]
      },
      environment: {
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/IG_ACCESS_TOKEN}'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'facebook-events': {
      handler: 'facebook-events/index.handler',
      package: {
        include: ['facebook-events/**']
      },
      environment: {
        COUNT: '6',
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/FB_ACCESS_TOKEN}',
        KEY_NAME: 'json/facebook-events.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'facebook-albums': {
      handler: 'facebook-albums/index.handler',
      package: {
        include: ['facebook-albums/**']
      },
      environment: {
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/FB_ACCESS_TOKEN}',
        KEY_NAME: 'json/facebook-albums.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    }
  }
};
<commit_msg>Instagram fetch key added in serverless config<commit_after>'use strict';

let stage = 'dev';
let bucket = 'www-dev.404.md';

if (process.argv[3] === 'master') {
  stage = 'master';
  bucket = 'www.404.md'
}

module.exports = {
  service: 'www-404-md',
  custom: {
    bucket: bucket,
    schedule: 'rate(1 day)'
  },
  provider: {
    name: 'aws',
    runtime: 'nodejs8.10',
    stage: stage,
    region: 'eu-central-1',
    environment: {
      BUCKET_NAME: '${self:custom.bucket}'
    },
    role: 'arn:aws:iam::492198229272:role/ServiceRoleForLambdaEdge'
  },
  package: {
    individually: true,
    exclude: ['./**'],
    include: ['common/**']
  },
  functions: {
    'medium-feed': {
      handler: 'medium-feed/index.handler',
      package: {
        include: ['medium-feed/**']
      },
      environment: {
        COUNT: '3',
        MAX_WIDTH: '590',
        KEY_NAME: 'json/medium-feed.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'instagram-feed': {
      handler: 'instagram-feed/index.handler',
      package: {
        include: ["instagram-feed/**"]
      },
      environment: {
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/IG_ACCESS_TOKEN}',
        KEY_NAME: 'json/instagram-feed.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'facebook-events': {
      handler: 'facebook-events/index.handler',
      package: {
        include: ['facebook-events/**']
      },
      environment: {
        COUNT: '6',
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/FB_ACCESS_TOKEN}',
        KEY_NAME: 'json/facebook-events.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    },
    'facebook-albums': {
      handler: 'facebook-albums/index.handler',
      package: {
        include: ['facebook-albums/**']
      },
      environment: {
        API_TOKEN: '${ssm:/CodeBuild/MitocGroup/FB_ACCESS_TOKEN}',
        KEY_NAME: 'json/facebook-albums.json'
      },
      events: [{schedule: '${self:custom.schedule}'}]
    }
  }
};

{'fraction_non_alphanumeric': 0.18581845612270556, 'fraction_numerical': 0.016092532059341212, 'mean_word_length': 2.429310344827586, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '1317769', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1351, 'n_words': 214}