curl wttr.in/seville

Nice weather forecast on your shell

Change Seville for your prefered city.
Sample Output
Weather for City: Sevilla, Spain

     \   /     Sunny
      .-.      28 ? 29 ?C     
   ― (   ) ―   ↗ 2 km/h       
      `-?      10 km          
     /   \     0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sun 28. Aug ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│      .-.      34 ? 36 ?C     │      .-.      39 ? 40 ?C     │      .-.      37 ? 38 ?C     │      .-.      34 ? 38 ?C     │
│   ― (   ) ―   ← 19 km/h      │   ― (   ) ―   ↗ 19 km/h      │   ― (   ) ―   ↗ 19 ? 24 km/h │   ― (   ) ―   ↗ 19 ? 24 km/h │
│      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │
│     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Mon 29. Aug ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│      .-.      33 ? 35 ?C     │      .-.      39 ?C          │      .-.      37 ? 40 ?C     │      .-.      35 ? 37 ?C     │
│   ― (   ) ―   ← 23 km/h      │   ― (   ) ―   ↗ 23 km/h      │   ― (   ) ―   ↗ 23 ? 34 km/h │   ― (   ) ―   ↑ 23 ? 27 km/h │
│      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │
│     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Tue 30. Aug ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│      .-.      29 ? 30 ?C     │      .-.      34 ? 36 ?C     │      .-.      37 ? 41 ?C     │      .-.      33 ? 35 ?C     │
│   ― (   ) ―   ↑ 23 km/h      │   ― (   ) ―   ↗ 23 km/h      │   ― (   ) ―   ↗ 23 ? 31 km/h │   ― (   ) ―   ↗ 23 ? 25 km/h │
│      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │      `-?      10 km          │
│     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘


37
By: nordri
2016-08-28 09:43:38

These Might Interest You

  • This shell function grabs the weather forecast for the next 24 to 48 hours from weatherunderground.com. Replace <YOURZIPORLOCATION> with your zip code or your "city, state" or "city, country", then calling the function without any arguments returns the weather for that location. Calling the function with a zip code or place name as an argument returns the weather for that location instead of your default. To add a bit of color formatting to the output, use the following instead: weather(){ curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}"|perl -ne '/<title>([^<]+)/&&printf "\x1B[0;34m%s\x1B[0m: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';} Requires: perl, curl Show Sample Output


    7
    weather(){ curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}"|perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';}
    eightmillion · 2010-02-10 01:23:39 8
  • you can use xmlstarlet to parse output instead of perl


    -2
    curl -s http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}|xmlstarlet sel -E utf-8 -t -m //forecast/txt_forecast/forecastday -v fcttext -n
    fanfani · 2010-04-13 22:14:48 0
  • Scrape the National Weather Service Show Sample Output


    4
    weather() { lynx -dump "http://mobile.weather.gov/port_zh.php?inputstring=$*" | sed 's/^ *//;/ror has occ/q;2h;/__/!{x;s/\n.*//;x;H;d};x;s/\n/ -- /;q';}
    zude · 2009-10-17 23:47:47 0

  • 0
    curl -s poncho.is/forecast/new_york/today/ | grep -E 'og:title|og:description' | cut -d\" -f4 | awk '{print $0,"<p>"}' | lynx -stdin -dump
    jc · 2013-08-21 21:43:11 0
  • weather 97405 Show Sample Output


    5
    weather() { curl -s "http://www.wunderground.com/q/zmw:$1.1.99999" | grep "og:title" | cut -d\" -f4 | sed 's/&deg;/ degrees F/'; }
    cadejscroggins · 2015-09-19 07:57:47 0
  • Grabs the current weather in your area (or their best guess of your area). Change the query to your zip code/location (e.g. google.com/search?q=weather+jakarta,+india) to get weather somewhere else. change google.com to google.ca or google.co.uk for metric. Show Sample Output


    -1
    wget -qO- -U '' 'google.com/search?q=weather' | grep -oP '(-)?\d{1,3}\xB0[FC]'
    slaufer · 2012-02-28 22:27:38 0

What Others Think

Nice service
MadMax · 90 weeks and 2 days ago
nice service indeed; shame it doesn't fit in a standard 80?25
scruss · 89 weeks and 2 days ago
Omit the city name and it guesses your location based on your IP address. Also understands US zip codes and Canadian postal codes.
reegmo · 88 weeks and 2 days ago
just pipe through head -n 7 if your term is small. you loose part of the forecast though.
atrament · 87 weeks and 4 days ago
Very nice indeed! Just a question, what's all this crap in the comments section?? Some of it's been there for weeks by the looks of things. Just asking.
Farstrider · 82 weeks and 2 days ago
The service?s geolocation sort of sucks for me. Try this: weather () { local info=$(curl -s ipinfo.io) && local city=$(echo $info | grep "\"city\": " | cut -d "\"" -f 4) && local country=$(echo $info | grep "\"country\": " | cut -d "\"" -f 4) && curl "wttr.in/$city,$country"; }; weather I turned it into a function for inclusion in shell startup files (or as a greeter) ;-)
lordtoran · 80 weeks ago
@Farstrider: Admin seems to be too lazy or too busy to write a spambot filter. When "make comment" is pressed, a script would run a set of anti-spam regexes on the comment body and request that the post be reworded if it is suspected spam. At least that's how I would approach the issue.
lordtoran · 80 weeks ago
dsad
yangping55 · 44 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: