在终端查看天气curl wttr.in
Tofloor
poster avatar
lq95v5
deepin
2019-02-28 17:49
Author
在终端输入 curl wttr.in 就可以查看所在地的天气了







Reply Favorite View the author
All Replies
avatar
fdgavmt8
deepin
2019-02-28 17:53
#1
不错 好用
Reply View the author
avatar
相对湿度
deepin
2019-02-28 18:36
#2
还是喜欢直接在qq上看天气
Reply View the author
avatar
海天鹰
deepin
2019-02-28 23:13
#3
本帖最后由 sonichy 于 2019-3-1 19:36 编辑

地址不对,在深圳,怎么设置?
Reply View the author
avatar
gx_waken
deepin
2019-05-19 07:08
#4
本帖最后由 gx_waken 于 2019-5-18 23:22 编辑

我试了下,可以直接在网址后加上地址名称或是指定一个ip地址给它判断位置,比如:
curl -s -4 zh.wttr.in/shenzhen
天氣預報: Shenzhen, China

    \  /       局部多云
  _ /"".-.     29..37 °C      
    \_(   ).   ↖ 22 km/h      
    /(___(__)  10 km         
               0.0 mm     

使用命令curl wttr.in/:help可以得到很多参数,可以用多种方式定位,可以加参数来显示哪个语言版本,显示近几天的天气预报,还是很方便的
Usage:    $ curl wttr.in          # current location    $ curl wttr.in/muc      # weather in the Munich airportSupported location types:    /paris                  # city name    /~Eiffel+tower          # any location    /Москва                 # Unicode name of any location in any language    /muc                    # airport code (3 letters)    /@stackoverflow.com     # domain name    /94107                  # area codes    /-78.46,106.79          # GPS coordinatesSpecial locations:    /moon                   # Moon phase (add ,+US or ,+France for these cities)    /moon@2016-10-25        # Moon phase for the date (@2016-10-25)Units:    m                       # metric (SI) (used by default everywhere except US)    u                       # USCS (used by default in US)    M                       # show wind speed in m/sView options:    0                       # only current weather    1                       # current weather + 1 day    2                       # current weather + 2 days    A                       # ignore User-Agent and force ANSI output format (terminal)    F                       # do not show the "Follow" line    n                       # narrow version (only day and night)    q                       # quiet version (no "Weather report" text)    Q                       # superquiet version (no "Weather report", no city name)    T                       # switch terminal sequences off (no colors)PNG options:    /paris.png              # generate a PNG file    p                       # add frame around the output    t                       # transparency 150    transparency=...        # transparency from 0 to 255 (255 = not transparent)Options can be combined:    /Paris?0pq    /Paris?0pq&lang=fr    /Paris_0pq.png          # in PNG the file mode are specified after _    /Rome_0pq_lang=it.png   # long options are separated with underscoreLocalization:    $ curl fr.wttr.in/Paris    $ curl wttr.in/paris?lang=fr    $ curl -H "Accept-Language: fr" wttr.in/parisSupported languages:    af da de fr fa et id it nb nl pl pt-br ro ru uk (supported)    az be bg bs ca cy cs el eo es fi hi hr hu hy is ja jv ka kk ko ky lt lv mk ml nl nn pt pt-br sk sl sr sr-lat sv sw th tr te uz vi zh zu he (in progress)Special URLs:    /:help                  # show this page    /:bash.function         # show recommended bash function wttr()    /:translation           # show the information about the translators
Reply View the author
avatar
bilibobo
deepin
2019-05-20 01:18
#5
收藏了。。。。。
Reply View the author
avatar
文刀
deepin
2019-05-20 01:40
#6
不错虽然已经安装了天气插件,不过感觉终端更适合Linux
Reply View the author