knadh / dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.
https://www.dns.toys
MIT License
2.48k stars 135 forks source link

Small cities not working for weather #20

Closed klikevil closed 2 years ago

klikevil commented 2 years ago

I checked on yr.no and they have the location available, but I can't search it with dig; it appears several several friends of mine live in (cumming and buford) cannot be looked up oddly, while places like 'broken arrow', modesto, and other small cities are easily searchable even as simple as west palm beach

$ sdig 'lawrenceville/US.weather' @dns.toys lawrenceville. 1 IN TXT "Lawrenceville (US)" "31.20C (88.16F)" "58.40% hu." "lightrainshowers_day" "17:00, Mon" lawrenceville. 1 IN TXT "Lawrenceville (US)" "30.10C (86.18F)" "62.50% hu." "partlycloudy_day" "19:00, Mon" lawrenceville. 1 IN TXT "Lawrenceville (US)" "27.20C (80.96F)" "78.90% hu." "partlycloudy_night" "21:00, Mon" lawrenceville. 1 IN TXT "Lawrenceville (US)" "25.90C (78.62F)" "86.80% hu." "fair_night" "23:00, Mon" lawrenceville. 1 IN TXT "Lawrenceville (US)" "24.70C (76.46F)" "90.70% hu." "partlycloudy_night" "01:00, Tue"

$ dig 'cumming/US.weather' @dns.toys

;; QUESTION SECTION: ;cumming/US.weather. IN A

;; ADDITIONAL SECTION: . 1 IN TXT "error: unknown city."

$ dig 'Buford/US.weather' @dns.toys

; <<>> DiG 9.11.5-P4-5-Debian <<>> Buford/US.weather @dns.toys ;; QUESTION SECTION: ;Buford/US.weather. IN A

;; ADDITIONAL SECTION: . 1 IN TXT "error: unknown city."

;; Query time: 76 msec

knadh commented 2 years ago

The data source is the cities15000.zip dump from here http://download.geonames.org/export/dump/

cities15000.zip          : all cities with a population > 15000 or capitals (ca 25.000), see 'geoname' table for columns

I can see that Cumming and Buford aren't in the file, but they're in the cities5000 file. Will test this out and switch to this data source to include smaller cities. Thanks for reporting this.

klikevil commented 2 years ago

The data source is the cities15000.zip dump from here http://download.geonames.org/export/dump/

cities15000.zip          : all cities with a population > 15000 or capitals (ca 25.000), see 'geoname' table for columns

I can see that Cumming and Buford aren't in the file, but they're in the cities5000 file. Will test this out and switch to this data source to include smaller cities. Thanks for reporting this.

Thanks for your very prompt response, this is great, i'm going to use it in my screenrc to query weather from now on (one request per 15 minutes) 😁❤

knadh commented 2 years ago
$ dig +short cumming.time @dns.toys
"Cumming (America/New_York, US)" "Wed, 15 Jun 2022 06:43:48 -0400"

$ dig +short buford.time @dns.toys
"Buford (America/New_York, US)" "Wed, 15 Jun 2022 06:44:35 -0400"

Switched the cities database. There are now 52k cities as opposed to 25k cities earlier.