Giter Club home page Giter Club logo

fmeteo's Introduction

fmeteo

English: Read Me version

fmeteo is a simple shell script that allows you to receive weather data from the OpenWeatherMap service and to return the processed data to the terminal (bash).

The script is thus provided with a custom apikey for immediate use. It is possible to use a personal api-key just substitute it in the variable that is included in the script.

dependencies:

curl

bc

jq

cat

use:

fmeteo [city-name] [option]

option:

-f              print "foorecast 5 days"
-a              "all": print weather now and forecast 5 day  
-j              get weather information in json format
"no option"     print weather now

note: some names of cities are made up of the aggregation of several names or terms, for some openweatermap recognizes them simply by writing them "all attacked" for others instead you have to write them separating them with the "space". In the terminal space is used to indicate the passage of further commands or options, so it is advisable to use the "%20" character as space and enclose the name in quotation marks.

Some examples:

for example we want to recover the "now weather data" of a city called "Tempio Pausania" (IT) or "New York"(USA) that openwatermap has indexed written with the space.

fmeteo "Tempio%20Pausania,IT"

fmeteo "New%20York,US"

example n2:

For example I want to know the current weather and the forecast of the next 5 days of "New York (USA)":

 fmeteo "New%20York,US" -a

or if we are a terminal that does not support xserver we can use a pager to display the data page by page:

  fmeteo "New%20York,US" -a | less

use space or the arrow to go forward or back, "q" to exit


Italian: Read Me version

fmeteo è un semplice script di shell che consente di ricevere dati meteo dal servizio OpenWeatherMap e di restituire nel terminale (bash) i dati processati.

Lo script così è fornito di una custom apikey per un immediata utilizzazione. E' possibile utilizzare un api-key personale basta sostituirla nella variabile approrpiata nello script.

dipendenze:

curl

bc

jq

cat

uso:

fmeteo [city-name] [option]

opzioni:

-f                    stampa a video la previsione dei 5 giorni
-a                    stampa il meteo corrente + la previsione dei 5 giorni
-j                    scarica le informazioni meteo in formato json
"nessuna opzione"     stampa il meteo corrente

nota bene: alcuni nomi di città sono costituiti dall'aggregazione di più nomi o termini, per alcuni openweatermap li riconosce semplicemente scrivendoli "tutti attacati" per altri invece bisogna scriverli separandoli con lo "spazio". Nel terminale lo spazio serve ad indicare il passaggio di ulteriori comandi o opzioni quindi è cosigliabile utilizzare il carattere "%20" come spazio e racchiudere il nome tra virgolette.

Alcuni esempi:

ad esempio vogliamo recuperare il meteo corrente di una citta chiamata "Tempio Pausania"(IT), oppure "New York"(USA) che openwatermap ha indicizzato scritta con lo spazio.

fmeteo "Tempio%20Pausania,IT"

fmeteo "New%20York,US"

esempio n2:

Ad esempio voglio sapere il meteo corrente e le previsioni dei prossimi 5 giorni di "New York"(USA):

fmeteo "New%20York,US" -a

oppure se siamo in un terminale che non supporta xserver possiamo usare un paginatore per visualizzare i dati pagina per pagina:

 fmeteo "New%20York,US" -a | less

usa spazio o le freccia per andare avanti o indietro, "q" per uscire

fmeteo's People

Contributors

fenix-soft avatar

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.