Files
Obsidian/Extras/Template/Diary.md

47 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
atlas: "[[DailyNote]]"
completed: 0
created: <% tp.date.now("YYYY-MM-DD HH:mm:ss") %>
incomplete: 3
modified:
tags:
- DailyNote
title: <% tp.file.title %>
total: 3
---
<%* let url = 'https://www.tianqi.com/yuexiuqu/'
let res = await request({url: url,method: "GET"});
res = res.replace(/\n/g,'')
let dqwd = /<p class="now"><b>(\d+)<\/b><i><\/i><\/p>/.exec(res)
let tqwdfw = /<span><b>(.*?)<\/b>(.*?)<\/span>/.exec(res)
let sdfxzwx = /<dd class="shidu"><b>(.*?)<\/b><b>(.*?)<\/b><b>(.*?)<\/b><\/dd>/.exec(res)
let kqzlrcrl = /<dd class="kongqi" ><h5 style="background-color:#[0-9a-z]{6};">(.*?)<\/h5><h6>(.*?)<\/h6><span>(.*?)<br \/>(.*?)<\/span><\/dd>/.exec(res)
let 天气 = '天气:' + tqwdfw[1]
let 温度范围 = '温度:' + tqwdfw[2]
let 湿度 = sdfxzwx[1]
let 风向 = sdfxzwx[2]
let 紫外线 = sdfxzwx[3]
let 空气质量 = kqzlrcrl[2] + '' + kqzlrcrl[1]
let 日出日落 = kqzlrcrl[3] + ' ' +kqzlrcrl[4] -%>
> [!tip] << [[<% tp.date.now("YYYY-MM-DD", -1) %>]] | [[<% tp.date.now("YYYY-MM-DD", 1) %>]] >>
> <% 天气 %><% 温度范围 %><% 湿度 %><% 空气质量 %> <br>
> <% 风向 %><% 紫外线 %><% 日出日落 %>
# 生活
- [ ] <% tp.file.cursor() %>
# 学习
- [ ]
# 工作
- [ ]
# 随笔
# 复盘
-