每日从集思录抓取可转债基本数据、强赎倒计时、下修倒计时,支持Cookie管理和本地持久化存储

v1.0.4

每日从集思录 webapi 抓取可转债基本数据、强赎倒计时、下修倒计时,支持Cookie管理和本地持久化存储

0· 81·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for cchunter/jisilu-cb-daily.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "每日从集思录抓取可转债基本数据、强赎倒计时、下修倒计时,支持Cookie管理和本地持久化存储" (cchunter/jisilu-cb-daily) from ClawHub.
Skill page: https://clawhub.ai/cchunter/jisilu-cb-daily
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install jisilu-cb-daily

ClawHub CLI

Package manager switcher

npx clawhub@latest install jisilu-cb-daily
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description describe scraping jisilu webapi for convertible-bond data; the script calls exactly the three jisilu endpoints listed (list/redeem/adjust), parses JSON, merges and saves CSV. Required artifacts (kbzw__user_login and kbzw__Session cookies) are exactly what the site requires for member data access.
Instruction Scope
SKILL.md and the script only read/write local files (references/cookie.json, output CSV) and call jisilu.cn endpoints. However, the runtime instructions ask the user to copy-paste their site cookies into the skill (potentially via the chat interface). That is functional for the task but sensitive: if you paste cookies into a remote/third-party chat or untrusted logs, you risk credential exposure. The script also prints the first 10 characters of cookies to stdout, which may appear in logs.
Install Mechanism
No install spec; this is an instruction-only skill with a Python script. Declared Python dependencies (requests, pandas) match the script. Nothing is downloaded from untrusted URLs or installed automatically by the skill.
Credentials
The skill requests no environment variables or external credentials beyond the site cookies (kbzw__user_login and kbzw__Session). That is proportional to the stated need. Those cookies are sensitive authentication tokens—users should treat them as secrets and avoid sharing them over untrusted channels.
Persistence & Privilege
The skill does persist data locally (references/cookie.json and output/*.csv) but has no elevated platform privileges (always:false). It does not modify other skills or system-wide configuration. The suggested cron usage is ordinary for local automation.
Assessment
This skill appears to do what it says, but it requires your jisilu login cookies (kbzw__user_login and kbzw__Session). Before installing or running: 1) Only run this skill in a trusted, local environment — do not paste your cookies into public or remote chats/logs. 2) Prefer creating a dedicated account with minimal privileges if possible. 3) Secure or delete references/cookie.json after use (it stores live auth tokens). 4) Cron logs may capture output (the script prints cookie prefixes); redirect or secure logs to avoid leaking tokens. 5) If you need stronger safety, modify the script to read cookies from a secure secret store or encrypt the cookie file.

Like a lobster shell, security has layers — review code before you run it.

latestvk97fa66ymvn57dcsra32kw2t2585pysy
81downloads
0stars
4versions
Updated 10h ago
v1.0.4
MIT-0

前置依赖

  • Python 3.8+
  • 依赖包:requests, pandas
  • 集思录账号(需要登录后的 kbzw__user_loginkbzw__Session Cookie)

Cookie 管理规范

存储位置

Cookie 存储在 Skill 目录下的 references/cookie.json

{
  "kbzw__user_login": "用户输入的cookie值",
  "kbzw__Session": "用户输入的session值",
  "updated_at": "2026-04-28"
}

检查逻辑

  1. 每次执行任务前,先检查 references/cookie.json 是否存在且包含 kbzw__user_loginkbzw__Session

  2. 如果任一不存在或为空,立即停止数据抓取,向用户发送以下提示:

    【集思录登录Cookie缺失】
    
    本Skill需要两个Cookie才能获取完整数据(尤其是cb/list等会员数据):
    
    1. kbzw__user_login
    2. kbzw__Session
    
    请按以下步骤获取:
    1. 用Chrome/Edge打开 https://www.jisilu.cn/ 并登录账号
    2. F12打开开发者工具 → Application/应用 → Cookies → https://www.jisilu.cn
    3. 分别找到 kbzw__user_login 和 kbzw__Session,复制它们的Value值
    4. 依次将两个Cookie值粘贴给我
    
    获取后我将自动保存,后续每日抓取无需重复输入。
    
  3. 收到用户提供的 Cookie 后,写入 references/cookie.json,然后继续执行

数据源与接口

接口1:可转债基本数据

  • URL: https://www.jisilu.cn/webapi/cb/list/
  • 方法: GET
  • Headers:
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
    Referer: https://www.jisilu.cn/web/data/cb/list
    Cookie: kbzw__user_login={cookie值}; kbzw__Session={session值}
    
  • 返回格式: JSON 平铺数组,直接取 data 字段
    {
      "data": [
        {
          "bond_id": "123045",
          "bond_nm": "某转债",
          "price": 105.50,
          "increase_rt": 1.23,
          "stock_nm": "某正股",
          "sprice": 10.50,
          "sincrease_rt": 2.10,
          "convert_price": 12.50,
          "convert_value": 84.00,
          "premium_rt": 25.60,
          "force_redeem_price": 16.25,
          "put_convert_price": 8.75,
          "year_left": 3.52,
          "ytm_rt": 2.35,
          "rating_cd": "AA+",
          "dblow": 131.10,
          "force_redeem": null,
          "maturity_dt": "2027-06-15"
        }
      ]
    }
    

接口2:强赎倒计时数据

  • URL: https://www.jisilu.cn/webapi/cb/redeem/
  • 方法: GET
  • Headers: 同上,需携带 Cookie
  • 返回格式: JSON 平铺数组 data
  • 关键字段:
    • bond_id: 转债代码
    • bond_nm: 转债名称
    • redeem_count: 已满足强赎天数
    • redeem_trigger: 强赎触发条件(如 15/30)
    • redeem_status: 强赎状态(如"公告强赎"、"暂不强赎"、"倒计时中")
    • redeem_price: 赎回价格
    • last_redeem_dt: 最后交易日

接口3:下修倒计时数据(主表,340条全量)

  • URL: https://www.jisilu.cn/webapi/cb/adjust/
  • 方法: GET
  • Headers: 同上,需携带 Cookie
  • 返回格式: JSON 平铺数组 data
  • 关键字段:
    • bond_id: 转债代码
    • bond_nm: 转债名称
    • adjust_count: 已满足下修天数
    • adjust_trigger: 下修触发条件
    • adjust_status: 下修状态(如"已公告下修"、"董事会提议"、"倒计时中")
    • adjust_price: 拟下修价格(如有)
    • adjust_dt: 下修股东大会日期

执行工作流

Step 1: Cookie 检查与准备

import json, os

cookie_path = os.path.join(os.path.dirname(__file__), "../references/cookie.json")

if not os.path.exists(cookie_path):
    raise FileNotFoundError("Cookie文件缺失,请按Skill说明提供 kbzw__user_login 和 kbzw__Session")

with open(cookie_path, "r", encoding="utf-8") as f:
    cookie_data = json.load(f)

kbzw_cookie = cookie_data.get("kbzw__user_login", "")
kbzw_session = cookie_data.get("kbzw__Session", "")
if not kbzw_cookie or not kbzw_session:
    raise ValueError("kbzw__user_login或kbzw__Session为空,请重新提供")

Step 2: 抓取下修倒计时数据(主表)

  • 使用 requests.get() 访问 https://www.jisilu.cn/webapi/cb/adjust/
  • 携带 Cookie: kbzw__user_login={kbzw_cookie}; kbzw__Session={kbzw_session}
  • 解析 JSON,直接取 data 字段为 DataFrame(约340条全量数据)

Step 3: 抓取强赎倒计时数据

  • 使用相同 Cookie 访问 https://www.jisilu.cn/webapi/cb/redeem/
  • 解析 JSON,直接取 data 字段
  • bond_id 为键,LEFT JOIN 到下修主表

Step 4: 抓取基本数据

  • 使用相同 Cookie 访问 https://www.jisilu.cn/webapi/cb/list/
  • 解析 JSON,直接取 data 字段
  • bond_id 为键,LEFT JOIN 到已有数据

Step 5: 数据清洗与保存

清洗规则

  1. 价格字段:去除 % 符号,转为 float
  2. 涨跌幅:同上处理
  3. 日期字段:统一转为 YYYY-MM-DD 格式
  4. 空值处理force_redeem 为空表示"暂不强赎";adjust_status 为空表示"未触发下修"
  5. 去重:按 bond_id 去重,保留最新记录

保存格式

数据保存为 CSV,按日期命名:

output/
└── jisilu_cb_2026-04-28.csv

CSV 必须包含以下核心字段:

字段名来源说明
bond_idadjust(主表)转债代码
bond_nmadjust(主表)转债名称
pricelist转债现价
increase_rtlist转债涨跌幅
stock_nmlist正股名称
spricelist正股现价
premium_rtlist溢价率
convert_pricelist转股价
year_leftlist剩余年限
ytm_rtlist到期收益率
rating_cdlist评级
dblowlist双低值
force_redeem_pricelist强赎触发价
put_convert_pricelist回售触发价
redeem_statusredeem强赎状态
redeem_countredeem已满足强赎天数
adjust_statusadjust(主表)下修状态
adjust_countadjust(主表)已满足下修天数
adjust_dtadjust(主表)下修股东大会日期
data_date系统生成数据日期(YYYY-MM-DD)

Step 6: 结果汇报

向用户汇报当日数据概况:

【集思录可转债数据抓取完成】
日期:2026-04-28
共抓取转债:XXX 只
其中:
- 公告强赎:XX 只
- 强赎倒计时中:XX 只
- 已公告下修:XX 只
- 下修倒计时中:XX 只

数据已保存至:output/jisilu_cb_2026-04-28.csv

异常处理

异常场景处理方式
Cookie 失效(返回 403/登录页)提示用户重新输入 Cookie,删除旧 cookie.json
接口返回空数据记录日志,重试最多 3 次,仍失败则跳过该接口
网络超时设置 timeout=30s,重试 3 次
字段缺失用空值填充,不中断流程
日期解析失败保留原始字符串,标注"解析异常"

定时执行建议

如需每日自动执行,可在本地 OpenClaw 中配合 cron/systemd:

# 每天 15:30 收盘后执行
30 15 * * * cd ~/.config/agents/skills/jisilu-cb-daily && python scripts/collect_jisilu_cb.py

或在 Kimi Claw 对话中每日发送指令:

执行 jisilu-cb-daily Skill 抓取今日可转债数据

Comments

Loading comments...