Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTC 时间转换 & 温度单位转换 #3

Open
xgqfrms opened this issue Dec 7, 2020 · 6 comments
Open

UTC 时间转换 & 温度单位转换 #3

xgqfrms opened this issue Dec 7, 2020 · 6 comments

Comments

@xgqfrms
Copy link
Owner

xgqfrms commented Dec 7, 2020

UTC 时间转换 & 温度单位转换

https://www.cnblogs.com/xgqfrms/p/14097254.html

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 7, 2020

xgqfrms added a commit that referenced this issue Dec 7, 2020
@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 7, 2020

weather-units bug

https://github.com/chubin/wttr.in#weather-units

$  curl wttr.in/Shanghai?u

$  curl wttr.in/Shanghai?m

image

image

but the default is OK

$  curl wttr.in/Shanghai

image

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 7, 2020

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 7, 2020

https://wttr.in/

  
#!/bin/sh

# ???
set -eux

# 设置 env
LANGUAGE="zh-CN"
CITY=Shanghai
UNIT=m
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4343.0 Safari/537.36"

# 文档见 wttr.in
curl \
  -H "Accept-Language: $LANGUAGE" \
  -H "User-Agent: $UA" \
  -o result.html \
  wttr.in/$CITY
  # wttr.in/$CITY?format=4\&$UNIT

https://github.com/xgqfrms/weather-email-action/blob/main/weather.sh

/Users/xgqfrms-mbp/Documents/GitHub/gitHub-secrets-all-in-one/weather.sh

#!/bin/sh

# ???
set -eux

# 设置 env
LANGUAGE="zh-CN"
CITY=Shanghai
# m === °C
UNIT=m
# u === °F (default)
# UNIT=u
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4343.0 Safari/537.36"

# 文档见 wttr.in
curl \
  -H "Accept-Language: $LANGUAGE" \
  -H "User-Agent: $UA" \
  -o result.html \
  wttr.in/$CITY?$UNIT
  # wttr.in/$CITY
  # wttr.in/$CITY?format=4\&$UNIT

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 7, 2020

image

@xgqfrms
Copy link
Owner Author

xgqfrms commented Sep 6, 2023

# fix zsh bug

$  curl "wttr.in/Shanghai?u"

$  curl "wttr.in/Shanghai?m"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant