Commit Graph

508 Commits

Author SHA1 Message Date
Gregory Danielson
303c2d2ab7
Observe two possible names for United States when checking us_ip 2020-11-15 11:13:15 -06:00
Gregory Danielson
bdcb24742d
Rework ipcache write to include new data from all sources 2020-11-15 11:10:19 -06:00
Gregory Danielson
c349dc2f17
Break from IPLOCATION method loop if one method produces non-null result 2020-11-15 11:02:12 -06:00
Gregory Danielson
34313eb162
Rework get_location to handle additions to location tuple; same return 2020-11-15 10:58:51 -06:00
Gregory Danielson
e8cc9adc7f
Rework geoip to include ccode, lat, long for cache purposes 2020-11-15 10:57:53 -06:00
Gregory Danielson
88cd84b5d2
Rework ipinfo to include ccode, lat, long for cache purposes 2020-11-15 10:57:22 -06:00
Gregory Danielson
b7517bce65
Rework ip2location to include ccode, lat, long for cache purposes 2020-11-15 10:56:43 -06:00
Gregory Danielson
66802657a5
Add COUNTRY_MAP dict for workaround function cleanliness 2020-11-15 10:54:51 -06:00
Gregory Danielson
117727bc2b
Add pycountry dependency for converting ISO code to country name 2020-11-15 10:53:59 -06:00
Igor Chubin
74283de5f5 Bind v3 2020-11-07 19:57:40 +01:00
Igor Chubin
626a106186 Fix bug with location format 2020-11-07 19:57:39 +01:00
Gregory Danielson
bd7dd05cca
Observe region in geolocator 2020-11-01 20:04:14 -06:00
Gregory Danielson
953284d3d1
Check US IP out of 2nd element of query_source_location, due to added region 2020-11-01 17:18:04 -06:00
Gregory Danielson
afde91211c
Check and observe region and country in building formatted location 2020-11-01 17:00:09 -06:00
Gregory Danielson
deb2a5d01f
Adjust ipcache to observe new region
THIS WILL INVALIDATE THE EXISTING CACHE!
The new cache now pulls data from all three of geoip, ip2location, and
ipinfo, and stores it in the relatively simple city;region;country
format.

The old format would either store city;country or store
countrycode;country;region;city directly from ip2location, so it is much
more consistent with this change.
2020-11-01 16:37:45 -06:00
Gregory Danielson
2ebdb15398
Adjust ipcachewrite to account for region addition 2020-11-01 16:37:26 -06:00
Gregory Danielson
c7d3b32d53
Remove cache operation from ip2location; shortcut where possible
This comes with something of a refactor.

- IP2LOCATION_KEY is now checked with `if not` to reduce indention
- ConnectionError is increased to RequestException to catch all requests
  errors
  - On that note, now raising for status too
2020-11-01 16:35:17 -06:00
Gregory Danielson
628a860d6d
Remove cache operation from ipinfo; shortcut where possible
This comes with something of a refactor.

- IPINFO_TOKEN is now checked with `if not` to reduce indention
- ConnectionError is increased to RequestException to catch all requests
  errors
  - On that note, now raising for status too
- Now catching ValueError in case of json parsing failure
2020-11-01 16:32:13 -06:00
Gregory Danielson
996485adf1
Remove cache operation from geoip; shortcut where possible 2020-11-01 16:31:46 -06:00
Gregory Danielson
e4ac3f266f
Do cache read and write in get_location instead of duplicated in each IPLOCATION_ORDER method 2020-11-01 16:31:15 -06:00
Gregory Danielson
7af4aaa8ec
Correct docstring for get_location 2020-11-01 16:30:00 -06:00
Gregory Danielson
e1adca3bf0
Add region into location formatting 2020-11-01 16:28:24 -06:00
Gregory Danielson
f3bce5f806
Unpack region from get_location call or fail case 2020-11-01 16:27:40 -06:00
Gregory Danielson
4fa1ebd995
Add location[2] to ipcachewrite for new region part of cache 2020-11-01 15:03:14 -06:00
Gregory Danielson
08be8787b1
Observe new region var in get_location 2020-11-01 13:50:05 -06:00
Gregory Danielson
c65614d230
Enable ipcache writes from geoip lookup 2020-11-01 13:45:32 -06:00
Gregory Danielson
ef477822ae
Coalesce location into 3-tuple in geoip lookup 2020-11-01 13:45:08 -06:00
Gregory Danielson
4996c5a553
Pass region through workaround for consistency 2020-11-01 13:42:31 -06:00
Gregory Danielson
511b13bdcb
Capture and return region from ipinfo lookup 2020-11-01 13:41:52 -06:00
Gregory Danielson
35a35a56e2
Capture region from ip2location lookup 2020-11-01 13:40:20 -06:00
Gregory Danielson
af9658f63b
Check ipcache before fetching from geoip 2020-11-01 13:19:45 -06:00
Gregory Danielson
0056a97386
Capture and return region from geoip lookup 2020-11-01 13:05:03 -06:00
Igor Chubin
3717e30837
Merge branch 'master' into patch-1 2020-10-15 06:20:14 +02:00
Amadeo García Torrano
54f0b6ec48
Small mistake v2
I don't know why I put 'reporte'... Weird word.
2020-10-14 18:49:35 -03:00
Amadeo García Torrano
5bc944e464
Small mistake
Forgot a preposition in the 'FOLLOW' message.
2020-10-14 18:37:47 -03:00
Amadeo García Torrano
ad57cf96ea
Spanish translation
- Fixed minor grammar issues.
- Translated Oymyakon in 'NOT_FOUND_MESSAGE'
2020-10-14 18:35:42 -03:00
Igor Chubin
9e62a8cdcb Basque translation, v2 view (#438) 2020-10-14 08:22:24 +02:00
Igor Chubin
91a5f77d2e JSON output mimetype (fixes #514) 2020-10-14 07:32:43 +02:00
Emil Lerch
17e6e6c218
initial metno implementation 2020-10-08 16:24:19 -07:00
Igor Chubin
79eea95904 moonphase depends on the hemishphere (#247) 2020-09-20 11:09:57 +02:00
Igor Chubin
a62e3d979d fxed a regression (geolocation cache) 2020-09-20 11:09:04 +02:00
Igor Chubin
4a980be2f3 se pyphoon from PATH 2020-09-20 09:59:23 +02:00
Igor Chubin
1c7d2854fc
Merge pull request #505 from elerch/ipinfo
support for ipinfo and ip to location ordering
2020-09-17 08:37:07 +02:00
Igor Chubin
385cec249d
Merge pull request #519 from johnnyapol/http
wttr_srv: implement http status codes, resolves #163
2020-09-16 21:42:24 +02:00
John C. Allwein
e745ac6a08
wttr_srv: implement http status codes, resolves #163
This change implements proper HTTP status codes
for wttr_srv, returning:

- 200 if request was successful
- 403 if location is blocked
- 429 if rate-limited
- 500 if internal error occurred (MALFORMED_RESPONSE_HTML_PAGE)
- 503 if the service is unavailable (CAPACITY_LIMIT_REACHED)
2020-08-27 17:17:26 -04:00
PinkPanther-ny
34ec4470d6
Update translations_v2.py
Add translation of Hungarian -- PinkPanther-ny
2020-08-22 18:07:08 +10:00
Emil Lerch
3c16ac7993
support for ipinfo and ip to location ordering 2020-07-27 17:25:44 -07:00
Igor Chubin
4a6b4ec797 v2: added Occitan translation (#494) 2020-07-15 18:16:36 +02:00
Igor Chubin
b85e5732ec added oc to PROXY_LANGS (#494) 2020-07-15 17:48:27 +02:00
Igor Chubin
6b8ef7c330 recovered hi-translation broken by #501 2020-07-15 17:40:42 +02:00
Quentí
9508b2b17e
Update translations.py 2020-07-14 21:29:24 +02:00
Igor Chubin
7ef0c450b3
Merge pull request #495 from skyme5/translation-hi
[new] hindi translations
2020-07-14 19:23:37 +02:00
Igor Chubin
05f04fc272 single line: now newline for %-notation by default (#496) 2020-07-09 20:30:19 +02:00
Aakash Gajjar
677d7e19dc
[new] hindi translations 2020-07-09 00:56:19 +05:30
zhiqiang
9995ba4bb9 Add missing blank in ThunderyShowers 2020-06-27 01:36:05 +08:00
Igor Chubin
09e0979581
Merge pull request #475 from owl73/master
Fix current time output of pngs
2020-06-26 07:57:43 +02:00
sudoLife
2080568f80
Fix minor translation issues
Irish is now added to the 'LOCATION' dictionary properly
Change 'how it looks like' to 'what it looks like'
2020-06-24 08:56:39 +03:00
owl73
4bdd28b883 Fix current time output of pngs 2020-06-23 07:41:07 -04:00
Igor Chubin
f51fda3447 Merge branch 'master' of https://github.com/chubin/wttr.in 2020-06-19 20:07:31 +02:00
Igor Chubin
5b9ccb31d5 format=j1: output in utf8 2020-06-19 20:07:21 +02:00
Manuel Rüger
8dc0e08f5e README: Document Prometheus format output 2020-06-13 11:32:45 +02:00
Igor Chubin
ac62bb7387 prometheus: removed help lines duplicates (#446) 2020-06-12 19:21:53 +02:00
Igor Chubin
dabfc55c8b prometheus format code clean up (#446) 2020-06-12 19:12:08 +02:00
Manuel Rüger
cc46d78442 prometheus: Add timestamp, astronomy fields 2020-06-12 15:34:25 +02:00
Manuel Rüger
5156b9e589 prometheus: Proper help format 2020-06-10 23:30:15 +02:00
Igor Chubin
d0023d7940 yet another typo fixed (#446, #469) 2020-06-10 22:25:54 +02:00
Igor Chubin
6c7cd5a367 typo fixed (#446, #469) 2020-06-10 22:20:15 +02:00
Manuel Rüger
5b7e10f7c6 prometheus: Add help descriptions, improve metric names 2020-06-10 21:59:45 +02:00
Manuel Rüger
1857581cce Fix prometheus output 2020-06-10 13:17:19 +02:00
Igor Chubin
a573ae27eb initial naïve Prometheus implementation (#446) 2020-06-09 23:11:11 +02:00
Igor Chubin
8b1a2658bb cache signature location handling fixed (#460, #466) 2020-06-09 08:25:11 +02:00
Igor Chubin
ef7d46723d dont cache cyclic requests (#460) 2020-06-08 07:26:38 +02:00
Igor Chubin
b0a9d27a20 v2: fixed alignment problems for nerdphonts (#363) 2020-06-07 18:48:49 +02:00
Igor Chubin
949f601263
Merge pull request #463 from spywhere/feel-like
lib/view/line.py: add feel like temperature
2020-06-05 21:22:04 +02:00
Igor Chubin
228b93aad5 nerd fonts: initial support of v2d/v2n view (#363) 2020-06-05 20:29:40 +02:00
Sirisak Lueangsaksri
f312641f1a lib/view/line.py: add feel like temperature 2020-06-05 16:55:37 +07:00
gnostiphage
6a7e25efa5
added dictionaries for weather-icons, aka nerd fonts 2020-06-04 14:20:11 -05:00
Igor Chubin
f488160294 even preciser wind direction visualization (#455) 2020-06-01 14:17:34 +02:00
Igor Chubin
4c32d57b39 enabled Irish translation in proxy (#305) 2020-06-01 13:04:41 +02:00
Conor OCallaghan
7def10c0eb #305 adding some more translation 2020-05-28 23:28:33 +01:00
Igor Chubin
64322d7b61 use WTTR_IP2LOCATION_KEY_FILE ot override ip2location key location 2020-05-24 19:19:36 +02:00
Igor Chubin
fbf4aad445 use WTTR_WWO_KEY_FILE to override WWO keyfile location (#238) 2020-05-24 19:09:24 +02:00
Igor Chubin
bac771051a v2?T: remve ansi codes (#202) 2020-05-24 18:18:01 +02:00
Igor Chubin
68e7b8bdb7 remve ansi codes from follow line (#202) 2020-05-24 18:12:32 +02:00
Igor Chubin
ce93b59a9e minor fix 2020-05-21 13:22:50 +02:00
renyhp
8a0ca47421
Add italian translation for v2 2020-05-20 15:33:08 +02:00
Igor Chubin
b20f31c148
Merge branch 'master' into basque_translations_update 2020-05-13 10:44:52 +02:00
Igor Chubin
ebb961797f added basque to proxy langs (#438) 2020-05-13 10:29:01 +02:00
Igor Chubin
d7afd94c31 v2: fixed bug with location behind polar circle 2020-05-13 10:22:38 +02:00
Iker Sagasti Markina
93cbeb8954 missing messages in lib/translations and share/we-lang/we-lang.go. Some spanish translations improved
missing messages in lib/translations and share/we-lang/we-lang.go. Some spanish translations improved
2020-05-12 12:09:57 +02:00
Igor Chubin
dd200a460b Merge branch 'master' into v2 2020-05-11 21:41:42 +02:00
Iker Sagasti Markina
76bbbb2292 Basque translations added 💃
files added
2020-05-11 18:41:03 +02:00
Igor Chubin
270d77dd5f line mode: astro funcs fixed 2020-05-10 23:09:53 +02:00
Igor Chubin
ddc08d6fba %c: added spaces after weather confidition when needed (#440) 2020-05-10 17:06:12 +02:00
Igor Chubin
24850db80e do not use u"" in python3 code 2020-05-10 17:04:25 +02:00
Igor Chubin
09e3d57b40 lib/cache.py: fixed expiration time 2020-05-07 23:41:13 +02:00
Igor Chubin
e1bd1bf4b4 lib/globals.py clean up 2020-05-07 23:38:45 +02:00
Igor Chubin
01a321c202 png rendering in a separate thread 2020-05-07 23:37:21 +02:00
Igor Chubin
12d3ea2035 view/wttr.py clean up 2020-05-07 09:37:36 +02:00
Igor Chubin
57f15b55c6 enabled partial Basque translation (#438) 2020-05-01 19:09:11 +02:00
Igor Chubin
6c7600c309 removed space before km/h (#433) 2020-05-01 18:48:19 +02:00
Igor Chubin
5e2ae43c96 updated from master 2020-05-01 18:48:14 +02:00
Igor Chubin
413f23bec3 /Moon language fixed 2020-04-30 21:57:25 +02:00
Igor Chubin
acb761be0d v2 html: minor fix 2020-04-30 11:21:00 +02:00
Igor Chubin
192e633607 cache.py: add timestamp to each entry 2020-04-30 11:20:32 +02:00
Igor Chubin
0d5f6c298c v2+png: new experimental query encoding 2020-04-29 21:35:23 +02:00
Igor Chubin
cecde8fec8 fixed location for localhost 2020-04-27 20:40:13 +02:00
Igor Chubin
e041280f27 do not pass query to view functions 2020-04-27 20:00:26 +02:00
Igor Chubin
0a8ab5e89f one-letter options in png files (#436) 2020-04-27 19:19:41 +02:00
Igor Chubin
2ef8435b36 line.py: use new astral lib 2020-04-27 19:04:27 +02:00
Igor Chubin
156ab97cf2 do not add followme to json output 2020-04-27 19:03:58 +02:00
Igor Chubin
26a5fa533a useragents fixed 2020-04-27 19:03:27 +02:00
Igor Chubin
40ad45ad03 minor fixes 2020-04-26 19:38:56 +02:00
Igor Chubin
16e9ba5740 added de and fr to PROXY_LANGS 2020-04-26 19:37:41 +02:00
Igor Chubin
71b3a70e02 view=format 2020-04-25 22:28:28 +02:00
Igor Chubin
fb21802982 fmt/png.py: font-size 2020-04-25 22:27:58 +02:00
Igor Chubin
9f5edb963e v2 html 2020-04-25 19:36:44 +02:00
Igor Chubin
094a506d51 lib/view/line.py cleanup 2020-04-25 18:57:11 +02:00
Igor Chubin
d5fae22cde view/wttr.py: fixed padding 2020-04-25 18:56:27 +02:00
Igor Chubin
4d9a4138aa lib/wttr_srv.py clean up 2020-04-25 18:19:00 +02:00
Igor Chubin
bbd031cb7b removed make_wttr_in_png() and other wttr.in specific functions 2020-04-24 22:02:14 +02:00
Igor Chubin
7a8327c13f moved parse_wttrin_png_name() to lib/parse_query.py 2020-04-24 21:58:47 +02:00
Igor Chubin
250a94c802 minor fixes of Arabic translation (#430) 2020-04-15 23:00:26 +02:00
Igor Chubin
a0fcbec776 enabled Arabic translation 2020-04-15 22:57:01 +02:00
beshoux
c05ee31fac
Add files via upload 2020-04-14 14:51:03 +02:00
Igor Chubin
a284ff9de4 v2: use different color for captions 2020-04-11 18:15:29 +02:00
Igor Chubin
a3bf070bb3 added iterm2 demo page 2020-04-11 18:15:29 +02:00
Joel Bennett
7801bd0468
Add PowerShell user agent
PowerShell web and rest cmdlets use an agent like `Mozilla/5.0, (Windows NT 10.0; Microsoft Windows 10.0.18362; en-US), PowerShell/7.0.0`
2020-04-10 15:19:27 -04:00
Igor Chubin
7565baaa85 use (query, parsed_query) args for views 2020-04-05 14:18:53 +02:00
Igor Chubin
8855e494cd cache png using cache.py 2020-04-05 13:52:25 +02:00
Igor Chubin
f4c7463209 lib/fmt/png.py: removed internal caching 2020-04-05 13:51:54 +02:00
Igor Chubin
a85cebaa15 lib/cache.py: cache binary objects 2020-04-05 13:48:16 +02:00
Igor Chubin
0ac4790007 lib/wttr_srv.py refactoring 2020-04-05 11:51:36 +02:00
Igor Chubin
e2cebf74f2 store big lru cache objects in files 2020-04-05 11:50:58 +02:00
Igor Chubin
826cedf1f0 moved wttr.py to lib/view/ 2020-04-04 18:04:27 +02:00
Igor Chubin
4ea5c74b03 extracted get_moon() to lib/view/moon.py 2020-04-04 14:49:53 +02:00
Igor Chubin
bb17342b06 import view, import format 2020-04-04 14:22:26 +02:00
Igor Chubin
f363315476 moved formats to format/ 2020-04-04 14:21:56 +02:00
Igor Chubin
e29e5784da moved views to view/ 2020-04-04 14:21:14 +02:00
Igor Chubin
5a6f7b317c v2 fix: show localtime 2020-04-03 22:04:35 +02:00
Igor Chubin
88340abec2 switched to python3 2020-04-03 21:49:51 +02:00
Igor Chubin
b98d919d3c switched to new astral version 2020-04-03 21:49:40 +02:00
Igor Chubin
ac1be8305b lib/location.py: python3 fixes 2020-04-03 20:58:51 +02:00
Igor Chubin
7dd42abe8d added lib/extract_emoji.py 2020-04-03 20:27:00 +02:00
Igor Chubin
9e3b32a97d use Han-fond for Han characters (#422) 2020-03-31 21:21:36 +02:00
Igor Chubin
c58a9ca8d1 updated twitter button 2020-03-31 21:05:59 +02:00
Igor Chubin
0764e069bb added ia to the proxy langs and full translations 2020-03-06 18:58:44 +01:00
Igor Chubin
158a035af9
Merge pull request #416 from dustinkredmond/master
Added Interlingua translation
2020-03-06 18:42:53 +01:00
Igor Chubin
d38ba63bc3
Merge pull request #395 from iago-lito/french_translation
French translation in v2 file for #324
2020-03-06 18:42:08 +01:00
Dustin Redmond
4897191a44 Added Interlingua translation 2020-03-06 10:30:52 -05:00