Skip to content

Commit

Permalink
Rename & add msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Yan committed Oct 23, 2019
1 parent 3d7c5cb commit 460bf5b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 48 deletions.
File renamed without changes.
12 changes: 12 additions & 0 deletions daily.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/data/data/com.termux/files/usr/bin/env bash

cd ~/daily-warm
cp .env.daily .env
echo $(date "+%n%Y-%m-%d %H:%M:%S")
./dwm.out
rm .env





48 changes: 1 addition & 47 deletions html.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,5 @@ package main

// HTML for email template
const HTML = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>每日一暖, 温情一生</title>
</head>
<body>
<div style="max-width: 375px; margin: 20px auto;color:#444; font-size: 16px;">
<h3 >{{one.Date}}</h3>
<h3 style="text-align: center">{{weather.City}}</h3>
<div style="padding: 0;width: 100%;">
<div><span style="color: #6e6e6e">天气:</span>{{weather.Weather}}</div>
<div><span style="color: #6e6e6e">温度:</span>{{weather.Temp}}</div>
<div><span style="color: #6e6e6e">湿度:</span>{{weather.Humidity}}</div>
<div><span style="color: #6e6e6e">风向:</span>{{weather.Wind}}</div>
<div><span style="color: #6e6e6e">空气:</span>{{weather.Air}}</div>
<div><span style="color: #6e6e6e">限行:</span>{{weather.Limit}}</div>
<div><span style="color: #6e6e6e">提示:</span>{{weather.Note}}</div>
</div>
<br><br>
<div>
<div><img width="100%" src="{{english.ImgURL}}"></div>
<div style="margin-top: 10px;line-height: 1.5">&emsp;&emsp;{{english.Sentence}}</div>
</div>
<br><br>
<div style="text-align: center">
<div>{{poem.Title}}</div>
<div style="font-size: 12px">{{poem.Dynasty}} {{poem.Author}}</div>
<br>
<div>{{poem.Content}}</div>
</div>
<br><br>
<div>
<div><img width="100%" src="{{one.ImgURL}}"></div>
<div style="margin-top: 10px;line-height: 1.5">&emsp;&emsp;{{one.Sentence}}</div>
</div>
<br><br>
<div>
<div><img width="100%" src="{{wallpaper.ImgURL}}"></div>
<div style="margin-top: 10px;line-height: 1.5">&emsp;&emsp;{{wallpaper.Title}}</div>
</div>
</div>
<br><br>
</body>
</html>
你想看到什么内容呢?
`
15 changes: 15 additions & 0 deletions msg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

echo -e "\
package main
// HTML for email template
const HTML = \`
$(cat msg.txt)
\`" > html.go

cp .env.msg .env

go run *.go

rm .env
1 change: 1 addition & 0 deletions msg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
你想看到什么内容呢?
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package main
// HTML for email template
const HTML = \`
$(cat email.html)
$(cat daily.html)
\`" > html.go

go run *.go > test.html
Expand Down

0 comments on commit 460bf5b

Please sign in to comment.