From 61a6a9580125c413791b991652e8ee1a8c8bfe21 Mon Sep 17 00:00:00 2001 From: hanez Date: Sun, 19 Jul 2026 16:47:49 +0200 Subject: [PATCH] Fix !weather returning HTML instead of weather data wttr.in now serves a full HTML page when it detects a browser-like User-Agent string. Replaced the fake Firefox UA in run_curl with "zynk/VERSION" so weather, forecast, and stock requests all return the expected format again. --- CHANGELOG.md | 5 +++++ zynk.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de8256..4a76778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +2026.07.19 – Fix !weather returning HTML. + +- Fixed `!weather` command returning `` instead of weather data: wttr.in now returns HTML when it detects a browser User-Agent, so replaced the fake Firefox UA string with `zynk/VERSION`. +- Version bumped to 0.34.1. + 2026.07.19 – Uptime command, remove !hello. - Added `!uptime` command: displays bot uptime in a human-readable format (days/hours/minutes/seconds). diff --git a/zynk.c b/zynk.c index 69de811..a2fd801 100644 --- a/zynk.c +++ b/zynk.c @@ -29,7 +29,7 @@ int asprintf(char **, const char *, ...); /* ---- constants ---- */ -#define VERSION "0.34.0" +#define VERSION "0.34.1" #define DEFAULT_SERVER "irc.libera.chat" #define OPENCODE_BIN "/usr/bin/opencode" #define CLR_RESET "\033[0m" @@ -1412,7 +1412,7 @@ static char *run_curl(const char *url) { close(fd[1]); int dn = open("/dev/null", O_WRONLY); if (dn >= 0) { dup2(dn, STDERR_FILENO); close(dn); } - execlp("curl", "curl", "-s", "--max-time", "10", "-A", "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0", url, (char *)NULL); + execlp("curl", "curl", "-s", "--max-time", "10", "-A", "zynk/" VERSION, url, (char *)NULL); _exit(127); } close(fd[1]);