Created
June 25, 2017 01:03
-
-
Save HughParsonage/e002e8929ac2ec592f10ee22ce9dac1f to your computer and use it in GitHub Desktop.
Prints the weather at your location (based on IP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (requireNamespace("bomrang", quietly = TRUE)) { | |
library(data.table) | |
library(bomrang) # devtools::install_github('ToowoombaTrio/bomrang') | |
`_nrst_stn_to_me` <- as.numeric(jsonlite::fromJSON("http://ip-api.com/json")[c("lat", "lon")]) | |
weather_here <- function() { | |
bomrang::get_current_weather(latlon = `_nrst_stn_to_me`, as.data.table = TRUE) %>% | |
.[, .(local_date_time, weather, rel_hum, apparent_t, air_temp, wind_dir, wind_spd_kt, gust_kt)] %>% | |
head | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment