c++ 从命令行获取参数_从命令行获取天气

c++ 从命令行获取参数

There's an awesome script making the rounds on Twitter and I've been as excited as everyone else so I thought I'd show it.  Many of us live eight hours a day within the command line (although I'm not a vim hippie like some of you) so I try to find new ways to accomplish tasks from within iTerm (like getting bitcoin value or stock quotes).  Many of these solutions include using cURL and this awesomeness is no exception!

Twitter上有一个很棒的脚本来回合,我和其他所有人一样兴奋,所以我想展示一下。 我们中的许多人每天都在命令行中生活8个小时(尽管我不像你们中的某些人那样活跃),所以我尝试找到在iTerm内完成任务的新方法(例如获得比特币价值股票报价 )。 这些解决方案中的许多解决方案都包括使用cURL,这一点也不例外!

curl weather

You can get weather information from command line using cURL and wttr.in:

您可以使用cURL和wttr.in从命令行获取天气信息:


# Allow geolocation
curl -4 wttr.in

# Request a city
curl -4 wttr.in/Madison


wttr.in does well to guess location if one isn't provided so in most cases you wont need to provide your city.

wttr.in很容易猜测是否未提供位置,因此在大多数情况下,您不需要提供城市。

There you go, another awesome way to get the information you need from command line!

到这里,从命令行获取所需信息的另一种绝佳方法!

翻译自: https://davidwalsh.name/get-weather-command-line

c++ 从命令行获取参数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值