diff --git a/engine-q/weather/get-weather.nu b/engine-q/weather/get-weather.nu index 6ce1909..b30af34 100644 --- a/engine-q/weather/get-weather.nu +++ b/engine-q/weather/get-weather.nu @@ -12,12 +12,12 @@ def locations [] { } def get_my_location [index: int] { - let loc_json = (fetch (locations | nth $index).0.location) - let city_column = (locations | nth $index).0.city_column - let state_column = (locations | nth $index).0.state_column - let country_column = (locations | nth $index).0.country_column - let lat_column = (locations | nth $index).0.lat_column - let lon_column = (locations | nth $index).0.lon_column + let loc_json = (fetch (locations | select $index).0.location) + let city_column = (locations | select $index).0.city_column + let state_column = (locations | select $index).0.state_column + let country_column = (locations | select $index).0.country_column + let lat_column = (locations | select $index).0.lat_column + let lon_column = (locations | select $index).0.lon_column # echo $loc_json if ($city_column | str length) > 1 { @@ -74,7 +74,7 @@ def get_weather_by_ip [locIdx: int, units: string] { { id: ($day.weather.0.id) dt: ($day.dt | into string | into datetime -z local | date format '%Y-%m-%d') - high: ($day.temp.max) + high: ($day.temp.max) low: ($day.temp.min) } }) @@ -112,7 +112,7 @@ def get_weather_by_ip [locIdx: int, units: string] { { id: ($day.weather.0.id) dt: ($day.dt | into string | into datetime -z local | date format '%Y-%m-%d') - high: ($day.temp.max) + high: ($day.temp.max) low: ($day.temp.min) } }) @@ -301,4 +301,4 @@ def get_emoji_by_id [id] { # This uses location 2 and Celcius degrees. f = Fahrenheit, c = Celcius # Since I live in the USA I have not tested outside the country. -# We'll take PRs for things that are broke or augmentations. \ No newline at end of file +# We'll take PRs for things that are broke or augmentations. diff --git a/engine-q/weather/timed_weather_run.nu b/engine-q/weather/timed_weather_run.nu index 75ab790..bfa6a52 100644 --- a/engine-q/weather/timed_weather_run.nu +++ b/engine-q/weather/timed_weather_run.nu @@ -70,10 +70,11 @@ def timed_weather_run [ $weather_table | update last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file } } else { + echo "Your command did not run because you are not on Windows..." # ToDo: refactor the info in the Windows section into another def. The only real difference # is where the temp file will be located. Mac & Linux probably should be in /tmp I guess. # everything else is linux or mac } } -timed_weather_run --command "get_weather" --interval 1min \ No newline at end of file +timed_weather_run --command "get_weather" --interval 1min