{"size": 722, "ext": "js", "max_stars_repo_path": "testing.js", "max_stars_repo_name": "cjchan93/telegram-bot", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "testing.js", "max_issues_repo_name": "cjchan93/telegram-bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "testing.js", "max_forks_repo_name": "cjchan93/telegram-bot", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.0, "max_line_length": 166, "alphanum_fraction": 0.6565096953}
'use strict';

const Telegram = require('telegram-node-bot');

//npm install request && npm install dotenv
const request = require('request');
const dotenv = require('dotenv').config();

// console.log(process.argv[2]) //user typing data
const address = process.argv[2];

const url = `https://api.openweathermap.org/data/2.5/weather?q=${address}&APPID=${process.env.API_KEY}&units=metric`;

request(url, (error, response, body) => {
    const data = JSON.parse(body);

    // console.log(`It's currently ${data.main.temp}°C outside`);
    console.log(`------ City: ${address} ------ \n It is ${data.weather.main} day with ${data.weather.description}. \n It's currently ${data.main.temp}°C outside.`);
});