<commit_before>const weather = require('yahoo-weather')

module.exports = getWeatherData

function getWeatherData(city, callback) {
  weather(city).then(data => {
    // console.log("location is:", data.location.city + ", " + data.location.country)
    // console.log("lat and log are:", data.item.lat + ", " + data.item.long)
    // console.log("temperature is:", data.item.condition.temp)
    // console.log("conditions are:", data.item.condition.text)
    callback(data)
  }).catch(err => {
    console.log(err);
  })
}

// getWeatherData('London')
// getWeatherData('Wellington')

// getWeatherData(function(response){
//   dispatch(type: 'ADD_QUESTION', payload: {correctTemp: data.item.condition.temp})
// })<commit_msg>Tidy code<commit_after>const weather = require('yahoo-weather')

module.exports = getWeatherData

function getWeatherData(city, callback) {
  weather(city).then(data => {
    callback(data)
  }).catch(err => {
    console.log(err);
  })
}
{'fraction_non_alphanumeric': 0.17946058091286307, 'fraction_numerical': 0.0, 'mean_word_length': 4.216216216216216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '6279008', 'n_tokens_mistral': 316, 'n_tokens_neox': 308, 'n_words': 49}