Comments (1)
Done a little digging. You make use of an API at wttr.in with curl.
The following line dictates how you display temperature in the (sub)plugin.
temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc
This takes the last word of the stdout from the fetch_weather_information() which in turn is the stdout of a curl call to wttr.in with format parameters %C and %t
The line is: curl -sL wttr.in/${fixedlocation// /%20}\?format="%C+%t$display_weather"
. 26th in weather.sh
Sadly, sometimes the output from this API is:
Unknown location; please try ~
with being replaced with coordinates
$ curl -SL wttr.in/~Eifal+Tuwer\?format="%C+%t&u"
Unknown location; please try ~not found
$ curl -SL wttr.in/~Eifel+Tower\?format="%C+%t&u"
Unknown location; please try ~49.9456277,6.5562824
$ curl -SL wttr.in/~49.9456277,6.5562824\?format="%C+%t&u"
Unknown location; please try ~49.9457915,6.5566064
$ curl -SL wttr.in/~49.9457915,6.5566064\?format="%C+%t&u"
Unknown location; please try ~49.9457915,6.5566064
This seems to not be an issue with how this plugin parses the input coordinates to the API. The fact that it breaks sometimes seemingly out of nowhere, and the following returned text from curl if we parse no format parameters gives me the impression that this is just their service being down sometimes.
the returned text from API without params:
Sorry, we are running out of queries to the weather service at the moment.
Here is the weather report for the default city (just to show you what it looks like).
We will get new queries as soon as possible.
You can follow https://twitter.com/igor_chubin for the updates.
======================================================================================
from tmux.
Related Issues (20)
- Question: Using external status plugin HOT 1
- Enhancement: Add a MPC/MPD Plugin HOT 2
- The sep does not fix the height of the status line
- Enhancement: Regarding Support Multiple Types of Batteries
- Strange lines HOT 1
- Bug: [Dracula TMUX theme wont load] HOT 2
- Bug: CPU usage is not shown HOT 1
- Bug: [this doesn't work] HOT 2
- 🐛 Bug: Documented flag set -g @dracula-show-fahrenheit false not working HOT 3
- Bug: @dracula-fixed-location doesn't accept values with spaces HOT 1
- CPU Percentage Not Displaying on MacOS HOT 1
- Bug: `network` module doesn't work on macOS 14.4 and later HOT 2
- Bug: Switch from default fahrenheit to celsius not work HOT 1
- Enhancement: Adding an indictor in tmux's tab to show minimized pane. HOT 1
- I want to hide the location or remove the location from powerline HOT 1
- Bug: Error obtaining wireless information on desktop Macs HOT 6
- WSL/Debian - Weather - Location Unavailable HOT 5
- Enhancement: also show NVIDIA gpu usage in laptops HOT 2
- Enhancement: documentation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux.