Skill: jiajiaoy/daily-quote (version 1.0.1)

--- name: daily-quote description: "Daily curated quote from philosophers, leaders, and thinkers — with author context and why it resonates today. Bilingual EN/CN shareable visual card." keywords: - 每日金句 - 今日金句 - 名言 - 励志 - 鸡汤 - 早安语录 - 每日名言 - 人生格言 - daily quote - quote of the day - motivational quote - morning motivation - inspirational quote - wisdom - daily inspiration metadata: openclaw: runtime: node: ">=18" --- # Daily Quote / 每日金句 Generate a beautiful daily inspirational quote card with bilingual (Chinese + English) presentation. ## Workflow 1. **Get today's date** — Use the current date to seed the quote selection. 2. **Search for a quote** — Use `web_search` to find an inspiring, thought-provoking quote. Search for quotes related to today's date, or a rotating theme (Monday=courage, Tuesday=wisdom, Wednesday=creativity, Thursday=perseverance, Friday=joy, Saturday=love, Sunday=reflection). Query example: `"inspirational quote [theme] famous"`. 3. **Select and translate** — Pick ONE powerful quote. Provide both English original and Chinese translation. Include the author name and brief context (1 line). 4. **Generate the visual card** — Create a single-file HTML artifact (saved to `/mnt/user-data/outputs/daily-quote.html`) with: ## Visual Design Requirements Create a stunning, full-viewport quote card. Each day should feel different: - **Layout**: Centered quote with generous whitespace. Author below. Date at top-right corner. - **Typography**: Use a distinctive serif or display font from Google Fonts (rotate between: Playfair Display, Cormorant Garamond, DM Serif Display, Libre Baskerville). Body text in a clean sans-serif. - **Background**: Rotating aesthetic — use CSS gradients, subtle patterns, or mesh gradients. Avoid plain white. Examples: warm sunset gradient, deep ocean tones, forest green to black, golden hour warmth. - **Bilingual display**: English quote prominent, Chinese translation below in slightly smaller size with a different weight. - **Micro-interactions**: Subtle fade-in animation on load. Quote text should animate in with a gentle reveal. - **Ad-ready zone**: Include a tasteful, empty `<div id="ad-slot-bottom" style="...">` at the bottom of the card (min-height 90px, centered, with a subtle dashed border in dev mode). This is the future ad placement area. - **Footer**: Small "Powered by ClawCode" text at the very bottom. ## Content Tone - Prefer quotes from diverse sources: Eastern and Western philosophers, scientists, writers, leaders - Avoid overly cliché quotes (no "be the change you wish to see" etc.) - Each quote should genuinely make someone pause and think ## Output Save as `/mnt/user-data/outputs/daily-quote.html` and present to user. --- ## 推送管理 ```bash # 开启每日推送（早晚各一次） node scripts/push-toggle.js on <userId> # 自定义时间和渠道 node scripts/push-toggle.js on <userId> --morning 08:00 --evening 20:00 --channel feishu # 关闭推送 node scripts/push-toggle.js off <userId> # 查看推送状态 node scripts/push-toggle.js status <userId> ``` 支持渠道：`telegram` / `feishu` / `slack` / `discord`

path: README.md
content: # Daily Quote — Inspirational Quote Skill

> Daily curated quotes — bilingual EN/CN visual card, ready to share.

[![clawhub](https://img.shields.io/badge/clawhub-daily--quote-blue)](https://clawhub.ai/skills/daily-quote)
[![openclaw](https://img.shields.io/badge/openclaw-skill-orange)](https://openclaw.ai)

## What it does

Daily Quote delivers one carefully chosen quote every day — from philosophers, leaders, writers, and thinkers — with a short explanation of its context and why it resonates today. Output is a beautiful bilingual card.

**Morning push** — quote of the day with author and context  
**Themes** — wisdom, resilience, creativity, leadership, life  
**Bilingual** — Chinese and English  
**Visual** — shareable card format

## Installation

```bash
openclaw install daily-quote
```

## Usage

```bash
openclaw run daily-quote morning
```

## Keywords

daily quote · quote of the day · motivational quote · morning motivation · inspirational quote · 每日金句 · 今日金句 · 名言 · 励志 · 早安语录 · 鸡汤

---

Built for [OpenClaw](https://openclaw.ai) · Published on [clawhub.ai](https://clawhub.ai/skills/daily-quote)


path: scripts/evening-push.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const USERS_DIR=path.join(__dirname,'../data/users');
const VOCAB_THEMES=["情感词汇", "科学词汇", "艺术文化", "商业词汇", "自然生态", "哲学词汇", "日常生活"];
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
const userId=sanitizeId(process.argv[2]||'default');
loadUser(userId);
const now=new Date();
const WEEKDAYS=['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
const MONTHS_EN=['January','February','March','April','May','June','July','August','September','October','November','December'];
const wd=now.getDay();
const date=`${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;
const weekday=WEEKDAYS[wd];
const month=now.getMonth()+1;
const day=now.getDate();
const month_en=MONTHS_EN[now.getMonth()];
const tomorrow_weekday=WEEKDAYS[(wd+1)%7];
const vocab_theme=VOCAB_THEMES[wd];
const tomorrow_vocab_theme=VOCAB_THEMES[(wd+1)%7];
console.log(`晚安语录🌙今天是${date}。请选一句关于结束与新开始、休息、今日与明日主题的晚间金句，来自哲学家、作家或诗人。原文+中文翻译，作者简介，3句睡前冥想引导。语气沉静，适合睡前阅读。`);


path: scripts/morning-push.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const USERS_DIR=path.join(__dirname,'../data/users');
const VOCAB_THEMES=["情感词汇", "科学词汇", "艺术文化", "商业词汇", "自然生态", "哲学词汇", "日常生活"];
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
const userId=sanitizeId(process.argv[2]||'default');
loadUser(userId);
const now=new Date();
const WEEKDAYS=['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
const MONTHS_EN=['January','February','March','April','May','June','July','August','September','October','November','December'];
const wd=now.getDay();
const date=`${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;
const weekday=WEEKDAYS[wd];
const month=now.getMonth()+1;
const day=now.getDate();
const month_en=MONTHS_EN[now.getMonth()];
const tomorrow_weekday=WEEKDAYS[(wd+1)%7];
const vocab_theme=VOCAB_THEMES[wd];
const tomorrow_vocab_theme=VOCAB_THEMES[(wd+1)%7];
console.log(`早安！今天是${weekday}（${date}）。根据今日主题（周一勇气/周二智慧/周三创造/周四坚持/周五喜悦/周六爱/周日反思）搜索一句精选名言。原文+中文翻译，作者及简介1句，解读2-3句，附今日行动提示。`);


path: scripts/push-toggle.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const SKILL='daily-quote',DEFAULT_MORNING='08:00',DEFAULT_EVENING='21:00';
const USERS_DIR=path.join(__dirname,'../data/users');
const ALLOWED_CH=new Set(['telegram','feishu','slack','discord']);
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function sanitizeTime(v,l){if(!/^\d{1,2}:\d{2}$/.test(v)){console.error('❌ 无效'+l);process.exit(1);}const[h,m]=v.split(':').map(Number);if(h>23||m>59){console.error('❌ 无效'+l);process.exit(1);}return{h,m};}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
function saveUser(u,d){fs.mkdirSync(USERS_DIR,{recursive:true});fs.writeFileSync(safeUserPath(u),JSON.stringify(d,null,2),'utf8');}
function enablePush(userId,opts){
  userId=sanitizeId(userId);
  const user=loadUser(userId);
  const mt=opts.morning||user.morningTime||DEFAULT_MORNING;
  const et=opts.evening||user.eveningTime||DEFAULT_EVENING;
  const{h:mh,m:mm}=sanitizeTime(mt,'--morning');
  const{h:eh,m:em}=sanitizeTime(et,'--evening');
  const ch=opts.channel||user.channel||'telegram';
  if(!ALLOWED_CH.has(ch)){console.error('❌ 不支持渠道:'+ch);process.exit(1);}
  const sk=`agent:main:${ch}:direct:${userId}`;
  console.log('__OPENCLAW_CRON_ADD__:'+JSON.stringify({name:`${SKILL}-morning-${userId}`,cronExpr:`${mm} ${mh} * * *`,tz:'Asia/Shanghai',session:'isolated',sessionKey:sk,channel:ch,to:userId,announce:true,timeoutSeconds:180,message:`node ${path.join(__dirname,'morning-push.js')} ${userId}`}));
  console.log('__OPENCLAW_CRON_ADD__:'+JSON.stringify({name:`${SKILL}-evening-${userId}`,cronExpr:`${em} ${eh} * * *`,tz:'Asia/Shanghai',session:'isolated',sessionKey:sk,channel:ch,to:userId,announce:true,timeoutSeconds:180,message:`node ${path.join(__dirname,'evening-push.js')} ${userId}`}));
  saveUser(userId,{...user,morningTime:mt,eveningTime:et,channel:ch,pushEnabled:true,updatedAt:new Date().toISOString()});
  console.log(`\n✅ ${SKILL} 推送已开启\n⏰ 早推: ${mt}  🌙 晚推: ${et}  📡 渠道: ${ch}\n关闭: node push-toggle.js off ${userId}`);
}
function disablePush(userId){
  userId=sanitizeId(userId);
  console.log(`__OPENCLAW_CRON_RM__:${SKILL}-morning-${userId}`);
  console.log(`__OPENCLAW_CRON_RM__:${SKILL}-evening-${userId}`);
  const user=loadUser(userId);
  saveUser(userId,{...user,pushEnabled:false,updatedAt:new Date().toISOString()});
  console.log(`✅ ${SKILL} 推送已关闭`);
}
function showStatus(userId){
  userId=sanitizeId(userId);
  const u=loadUser(userId);
  console.log(`\n📡 ${SKILL} — ${userId}\n状态: ${u.pushEnabled?'✅ 开启':'❌ 关闭'}  早推: ${u.morningTime||DEFAULT_MORNING}  晚推: ${u.eveningTime||DEFAULT_EVENING}  渠道: ${u.channel||'telegram'}\n`);
}
if(require.main!==module)return;
const[cmd,uid,...rest]=process.argv.slice(2);
if(!cmd||!uid){console.log('用法: node push-toggle.js on|off|status <userId>');process.exit(1);}
const opts={};
const mi=rest.indexOf('--morning');if(mi!==-1)opts.morning=rest[mi+1];
const ei=rest.indexOf('--evening');if(ei!==-1)opts.evening=rest[ei+1];
const ci=rest.indexOf('--channel');if(ci!==-1)opts.channel=rest[ci+1];
if(cmd==='on')enablePush(uid,opts);
else if(cmd==='off')disablePush(uid);
else if(cmd==='status')showStatus(uid);
else{console.error('❌ 未知命令:'+cmd);process.exit(1);}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)