<commit_before>'use strict'

const _ = require('lodash');
const request = require('request');

const config = require('../config');
const newsApiKey = config.getNewsApiKey();
const personalGreetings = config.getPersonalGreetings();
const stocks = config.getStocks();
const userProfile = config.getUserProfile();
const weatherApiKey = config.getWeatherApiKey();

// change news source as needed
const newsApiBaseUrl = 'https://newsapi.org/v1/articles?source=google-news&sortBy=top&apiKey=' + newsApiKey;
const stocksApiBaseUrl = 'http://www.google.com/finance/info?q=';
const weatherByCityBaseUrl = 'http://api.openweathermap.org/data/2.5/weather?appid=' + weatherApiKey + '&q=';


module.exports.returnNews = (req, res) => {

  request(newsApiBaseUrl, function (error, response, body) {
    if (error) {
      console.log(error);
      return res.status(500).end();
    };
    body = JSON.parse(body);
    res.json(body.articles);
  })
};

<commit_msg>Updated weather unit to metric<commit_after>'use strict'

const _ = require('lodash');
const request = require('request');

const config = require('../config');
const newsApiKey = config.getNewsApiKey();
const personalGreetings = config.getPersonalGreetings();
const stocks = config.getStocks();
const userProfile = config.getUserProfile();
const weatherApiKey = config.getWeatherApiKey();

// change news source as needed
const newsApiBaseUrl = 'https://newsapi.org/v1/articles?source=google-news&sortBy=top&apiKey=' + newsApiKey;
const stocksApiBaseUrl = 'http://www.google.com/finance/info?q=';
const weatherByCityBaseUrl = 'http://api.openweathermap.org/data/2.5/weather?units=metric' + '&appid=' + weatherApiKey + '&q=';


module.exports.returnNews = (req, res) => {

  request(newsApiBaseUrl, function (error, response, body) {
    if (error) {
      console.log(error);
      return res.status(500).end();
    };
    body = JSON.parse(body);
    res.json(body.articles);
  })
};


{'fraction_non_alphanumeric': 0.15832903558535327, 'fraction_numerical': 0.006188757091284167, 'mean_word_length': 4.9327217125382266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4584611', 'n_tokens_mistral': 640, 'n_tokens_neox': 616, 'n_words': 121}