Skip to content

Commit

Permalink
Update npm_downloads.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Messi authored Aug 7, 2024
1 parent 173d147 commit 11665f3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions script/npm_downloads.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// script/npm_downloads.js

const axios = require('axios');
const { execSync } = require('child_process');

Expand All @@ -24,8 +22,6 @@ async function main() {
// 计算当月的总下载量
const totalDownloads = downloads.reduce((sum, download) => sum + download.downloads, 0);

const today = new Date().toISOString().split('T')[0];
const title = `NPM 下载量 (${today})`;
const body = totalDownloads > 0
? `${packageName} 包当月的总下载量是 ${totalDownloads}`
: `${packageName} 包本月没有下载量数据`;
Expand All @@ -34,11 +30,11 @@ async function main() {
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"body": "${body}",
"title": "Github Actions",
"title": "NPM 下载量",
"badge": 1,
"category": "Github Actions",
"sound": "multiwayinvitation.caf",
"icon": "https://seeklogo.com/images/N/npm-logo-01B8642EDD-seeklogo.com.png",
"icon": "https://www.vectorlogo.zone/logos/npmjs/npmjs-tile.svg",
"group": "Github Actions"
}'`;

Expand Down

0 comments on commit 11665f3

Please sign in to comment.