<commit_before>'use strict';

const https = require("https");
// Google Maps <KEY>
// https://maps.googleapis.com/maps/api/geocode/json?address=Odense%20Denmark&key=<KEY>

// Darksky 558592e8030e3dc0e74aca942f611848
// https://api.darksky.net/forecast/558592e8030e3dc0e74aca942f611848/37.8267,-122.4233 (lat, long)

// Convert request input from array to string
const requestInput = process.argv.slice(2).join(" ");

function getWeather(input) {
    
}


getWeather(requestInput);<commit_msg>convert input to lat/long because DarkSky wants it that way<commit_after>'use strict';

const https = require("https");
// Google Maps <KEY>
// https://maps.googleapis.com/maps/api/geocode/json?address=Odense%20Denmark&key=<KEY>

// Darksky 558592e8030e3dc0e74aca942f611848
// https://api.darksky.net/forecast/558592e8030e3dc0e74aca942f611848/37.8267,-122.4233 (lat, long)

// Convert request input from array to string
const requestInput = process.argv.slice(2).join(" ");

function getWeather(input) {
    let data = "";
    
    // Converting input city to lat/long for darksky API
    https.get(`https://maps.googleapis.com/maps/api/geocode/json?address=${input}&key=<KEY>`, (response) => {
        response.on("data", (dataChunk) => {
            data += dataChunk;
        });

        // Request done
        response.on("end", () => {
            let parsedData = JSON.parse(data);

            // Variables for next request
            let lat = parsedData.results[0].geometry.location.lat;
            let long = parsedData.results[0].geometry.location.lng;
            
            
        });
    });
}


getWeather(requestInput);
{'fraction_non_alphanumeric': 0.14617737003058104, 'fraction_numerical': 0.07706422018348624, 'mean_word_length': 3.2056555269922877, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, 'https://': 5, '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': '1004091', 'n_tokens_mistral': 615, 'n_tokens_neox': 547, 'n_words': 94}