Giter VIP home page Giter VIP logo

Comments (1)

Edvid avatar Edvid commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.