diff --git a/xtrn/wttr.in/readme.txt b/xtrn/wttr.in/readme.txt index d57c59beaf53909050995bc5d7a76810f070a65d..416a59957f62e56e33c3262ec5fa1f7e0188c41a 100644 --- a/xtrn/wttr.in/readme.txt +++ b/xtrn/wttr.in/readme.txt @@ -33,14 +33,10 @@ Contents 3) Customization - Please see https://wttr.in/:help for a list of options. You may pass any - of the 'Units' and 'View options' values to this script on the command - line to customize the output, for example: + Any arguments that you pass on the command line will be treated as an + alternate URL to query. For example: - Command Line ?wttr.js m0AFn + Command Line ?wttr.js https://wttr.in/?m0AFn - The default is 'AFn' for ANSI, no 'Follow' line, and narrow output. - - Note that your command line argument will completely replace the default - parameters. You will probably want to specify 'A' and 'n' in addition to - your chosen values. + The default is URL is 'https://wttr.in/?AFn' for ANSI, no 'Follow' line, + and narrow output. diff --git a/xtrn/wttr.in/wttr.js b/xtrn/wttr.in/wttr.js index aca8871abd4adf132d08ca4d626fd7217b6138ad..ccc724c7edac7d3a1aec09a26ae577522336fa1a 100644 --- a/xtrn/wttr.in/wttr.js +++ b/xtrn/wttr.in/wttr.js @@ -8,10 +8,10 @@ function uReplace(str) { } function fetchWeather(addr) { - const qs = argc > 0 ? argv.join('') : 'AFn'; + const qs = argc > 0 ? argv.join('') : 'https://wttr.in/?AFn'; const http = new HTTPRequest(); if (addr !== undefined) http.extra_headers = { 'X-Forwarded-For': addr }; - const body = http.Get('https://wttr.in/?' + qs); + const body = http.Get(qs); if (http.response_code !== 200) throw new Error('wttr.in response had status ' + http.response_code); return body; }