Skip to content

Commit

Permalink
优化推送通知卡片的展示
Browse files Browse the repository at this point in the history
  • Loading branch information
easychen committed May 28, 2022
1 parent 55f65ee commit fe741f7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

## 最新版本

- 插件·Chrome/Edge:[2022.05.27.19.05](ckc.zip)
- 自架云端Docker镜像:2022.05.27.19.01
- 文档:2022.05.27.19.05
- 插件·Chrome/Edge:2022.05.28.23.49 [下载](ckc.zip)
- 自架云端Docker镜像:2022.05.28.23.42 [Docker Hub](https://hub.docker.com/repository/docker/easychen/checkchan)
- 文档:2022.05.28.23.49
- 更新日志:[GitHub](https://github.com/easychen/checkchan-dist/commits/main)

自架云端 Docker 命令( 将`API Key``YouRAPiK1`替换成`任意你想要的安全密码不要带$`):
Expand Down
4 changes: 2 additions & 2 deletions README.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

## 最新版本

- 插件·Chrome/Edge:[{ext-build}](ckc.zip)
- 自架云端Docker镜像:{img-build}
- 插件·Chrome/Edge:{ext-build} [下载](ckc.zip)
- 自架云端Docker镜像:{img-build} [Docker Hub](https://hub.docker.com/repository/docker/easychen/checkchan)
- 文档:{doc-build}
- 更新日志:[GitHub](https://github.com/easychen/checkchan-dist/commits/main)

Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2022.05.27.19.05"
"2022.05.28.23.49"
Binary file modified ckc.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion docker.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2022.05.27.19.01"
"2022.05.28.23.42"
6 changes: 4 additions & 2 deletions docker/api/cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ for( const item of to_checks )
let desp = short(check_content,50) + (last_content && item.when == 'change' ? ('←' + short(last_content,50)):"");

const link = check_link || item.page || item.url;
desp += "\r\n\r\n [去看看]("+ link +") \r\n\r\n";
const short_content = desp;

desp += "\r\n\r\n[详情链接]("+ link +") \r\n\r\n";

if( check_html )
desp += "\r\n\r\n---\r\n\r\n" + to_markdown(check_html);
Expand All @@ -182,7 +184,7 @@ for( const item of to_checks )
// const desp = check_content.length > 50 ? (check_html ? to_markdown(check_html) : check_content) : check_content + (item.last_content ? ('←' + item.last_content):"") ;


await send_notify( title, desp , item.sendkey, item.send_channel || -1);
await send_notify( title, desp , item.sendkey, item.send_channel || -1, short_content);
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions docker/api/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function short( maybe_string , len = 0 )
if( isNumeric( maybe_string )) return maybe_string;
if (typeof maybe_string === 'string' || maybe_string instanceof String)
{
if( len < 1 ) return maybe_string;
return maybe_string.substring( 0, len );
if( len < 1 ) return maybe_string.replace(/^"(.+)"$/ig, '\$1');
return maybe_string.replace(/^"(.+)"$/ig, '\$1').substring( 0, len );
}else
{
// maybe object
Expand Down Expand Up @@ -141,11 +141,12 @@ exports.get_cookies = () =>
return json_data.cookies;
}

exports.send_notify = async ( title, desp, sendkey, channel = -1) =>
exports.send_notify = async ( title, desp, sendkey, channel = -1, short = false) =>
{
try {
const form = new FormData();
if( channel >= 0 ) form.append( 'channel',parseInt(channel));
if( short ) form.append( 'short',short );
form.append( 'title',title );
form.append( 'desp',desp.substring(0,10000) );
const response = await fetch( 'https://sctapi.ftqq.com/'+sendkey+'.send', {
Expand Down Expand Up @@ -311,6 +312,7 @@ async function monitor_dom(url, path, delay , cookies, id)
args: ['--no-sandbox'],
defaultViewport: null,
headless: true,
timeout:delay+1000*10,
};

if( process.env.CHROMIUM_PATH )
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ <h1>Check酱</h1>
</ol>
<h2>最新版本</h2>
<ul>
<li>插件·Chrome/Edge:<a href="ckc.zip">2022.05.27.19.05</a></li>
<li>自架云端Docker镜像:2022.05.27.19.01</li>
<li>文档:2022.05.27.19.05</li>
<li>插件·Chrome/Edge:2022.05.28.23.49 <a href="ckc.zip">下载</a></li>
<li>自架云端Docker镜像:2022.05.28.23.42 <a href="https://hub.docker.com/repository/docker/easychen/checkchan" rel="nofollow">Docker Hub</a></li>
<li>文档:2022.05.28.23.49</li>
<li>更新日志:<a href="https://github.com/easychen/checkchan-dist/commits/main">GitHub</a></li>
</ul>
<p>自架云端 Docker 命令( 将<code class="notranslate">API Key</code><code class="notranslate">YouRAPiK1</code>替换成<code class="notranslate">任意你想要的安全密码不要带$</code>):</p>
Expand Down
6 changes: 3 additions & 3 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ <h1>Check酱</h1>
</ol>
<h2>最新版本</h2>
<ul>
<li>插件·Chrome/Edge:<a href="ckc.zip">2022.05.27.19.05</a></li>
<li>自架云端Docker镜像:2022.05.27.19.01</li>
<li>文档:2022.05.27.19.05</li>
<li>插件·Chrome/Edge:2022.05.28.23.49 <a href="ckc.zip">下载</a></li>
<li>自架云端Docker镜像:2022.05.28.23.42 <a href="https://hub.docker.com/repository/docker/easychen/checkchan" rel="nofollow">Docker Hub</a></li>
<li>文档:2022.05.28.23.49</li>
<li>更新日志:<a href="https://github.com/easychen/checkchan-dist/commits/main">GitHub</a></li>
</ul>
<p>自架云端 Docker 命令( 将<code class="notranslate">API Key</code><code class="notranslate">YouRAPiK1</code>替换成<code class="notranslate">任意你想要的安全密码不要带$</code>):</p>
Expand Down

1 comment on commit fe741f7

@vercel
Copy link

@vercel vercel bot commented on fe741f7 May 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

checkchan-dist – ./

ckc.ftqq.com
checkchan-dist-morexmore.vercel.app
checkchan-dist-git-main-morexmore.vercel.app

Please sign in to comment.