This is a program for entering current weather data into an Excel spreadsheet (Excel must be installed on your computer)
make_worksheet | Make blank template | -path Path of the file to be created (eg. $home\Desktop\test.xlsx) | -worksheet_name Name of the first page of the sheet | |||
open_and_write | Enter weather data to Excel file | -path Path of the file into which the data is to be entered (eg. $home\Desktop\test.xlsx) | -row Row into which we enter data (e.g. row 1 is the first empty line to enter data) | -worksheet_name Name of the page to which we want to enter data | ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ-APIKey Your weatherapi.com API Keyㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ | -City City you want to enter weather data from |
new_page | Make new page in worksheet | -path Path of the file to which we are adding a new page (eg. $home\Desktop\test.xlsx) | -worksheet_name Name of the new page | |||
wait_until_hour | Waits until a given hour or waits until a given hour has passed | -wait_until_hour Hour we are waiting for / that is about to pass | -waiting_until If $true - waits for a given hour If $false - waits for the given hour to pass | |||
enter_data | Enters data into a sheet in actual location (if the sheet does not exist, creates one in actual location) | -row Row into which we enter data (e.g. row 1 is the first empty line to enter data) | -worksheet_name Name of the page to which we want to enter data |
Change line 89 ($URL = "https://api.weatherapi.com/v1/current.json?key=$APIKey&q=$City&aqi=yes"
) to this:
$URL = "https://api.weatherapi.com/v1/current.json?key=$APIKey&q=$City&aqi=yes&lang=YOUR_LANGUAGE"
,
where YOUR_LANGUAGE is your lang code
All available lang codes are in the table below:
Language | lang code |
---|---|
Arabic | ar |
Bengali | bn |
Bulgarian | bg |
Chinese Simplified | zh |
Chinese Traditional | zh_tw |
Czech | cs |
Danish | da |
Dutch | nl |
Finnish | fi |
French | fr |
German | de |
Greek | el |
Hindi | hi |
Hungarian | hu |
Italian | it |
Japanese | ja |
Javanese | jv |
Korean | ko |
Mandarin | zh_cmn |
Marathi | mr |
Polish | pl |
Portuguese | pt |
Punjabi | pa |
Romanian | ro |
Russian | ru |
Serbian | sr |
Sinhalese | si |
Slovak | sk |
Spanish | es |
Swedish | sv |
Tamil | ta |
Telugu | te |
Turkish | tr |
Ukrainian | uk |
Urdu | ur |
Vietnamese | vi |
Wu (Shanghainese) | zh_wuu |
Xiang | zh_hsn |
Yue (Cantonese) | zh_yue |
Zulu | zu |
Download function.ps1
program, change "YOUR_API_KEY" to your weatherapi.com API Key and "YOUR_CITY_NAME" to your city name.
Then, copy this code into the powershell console, press Enter.
Now you can enter the above commands into the powershell console.
Download code.ps1
program, change "YOUR_API_KEY" to your weatherapi.com API Key and "YOUR_CITY_NAME" to your city name.
Then, copy this code into the powershell console, press Enter.
The program is designed to operate 24 hours a day, 7 days a week. At the following hours (5, 9, 13, 17, 21) he enters the appropriate data into the sheets.