dsh-toutiao: Toutiao Trending Topic Collection and Semi-Automatic Draft Publishing Plugin

Preface

The DeepSeek Harness (DSH) plugin ecosystem follows an “everything is a plugin” philosophy, allowing developers to extend core capabilities through independent plugins. In agent development, common requirements include fetching real-time trending topics, retrieving content from specific domains, and preparing materials for content creation. Existing solutions often require manually browsing web pages, copy-pasting, or relying on unstable third-party APIs. This plugin performs these operations via pure HTTP collection within DSH and also supports being called by other plugins.

Plugin Overview

dsh-toutiao is a Toutiao-related DSH plugin maintained by N006Unnamed, classified under “Web Tools.” It does not depend on login sessions or request signing. It directly collects data from public pages and APIs, providing trending lists, keyword search, full-text retrieval, daily digest material, and semi-automatic draft publishing capabilities. The plugin has a dedicated card in the DSH settings panel and simultaneously exposes data interfaces outward through the Cordis service.

Core Features

Trending List Collection

The plugin fetches the hot-board API, returning 20 trending items by default with a maximum of 50. Each item includes a title, heat score, tags, and a link. Trending data is automatically cached to reduce redundant requests.

Keyword Search

The plugin scrapes the SSR search page to retrieve titles, summaries, sources, timestamps, and links. It returns 12 results by default with a maximum of 30.

Full-Text Retrieval

It accesses the mobile version at m.toutiao.com/group/<id>/ via RENDER_DATA to obtain the complete article body. This method requires no login.

Daily Digest Material

Each trending item is automatically supplemented with a real media summary rather than fabricated facts. Use digestTop to control how many top trending items are covered, and perKeyword to control how many results are fetched per keyword.

Draft Publishing

Based on search results or the trending list, it generates a title, summary, body, and topic tags, then produces a local preview page for copying. The publishing step is semi-automatic: the plugin prepares the content and generates the preview, while the final publish action is performed by a human on the Toutiao Creator Platform. Neither platform offers an open publishing API for individual users.

Scheduled Fetching

Configure the interval (in minutes, 5–1440) in the DSH settings panel. Once enabled, the plugin automatically fetches the trending list at the specified interval.

Installation & Activation

Using the desktop profile as an example, follow these steps:

  1. Copy the entire dsh-toutiao directory to ~/.dsh/profiles/desktop/node_modules/dsh-toutiao/
  2. Add dsh-toutiao to both dependencies and dsh.profile.bundles in ~/.dsh/profiles/desktop/package.json
  3. Restart the DeepSeek Harness application

After installation, a “Toutiao Trends” section will appear on the left side of the DSH settings panel, where you can configure result limits, keywords, scheduled fetching, and other options.

Typical Usage

Settings Panel (Web UI)

In the DSH settings panel, click the “Fetch Current Trends Now” button to pull the trending list once and display it. Enter a keyword for an instant search. Click “Generate Publishing Draft” to create a draft preview in one click.

Model Tools

The plugin registers 5 tools in DSH:

  • toutiao_hot: Trending list, parameter limit
  • toutiao_search: Keyword search, parameters keyword, limit
  • toutiao_article: Full article text, parameter id or URL
  • toutiao_digest: Trending daily digest material, parameters top, keywords
  • toutiao_draft: Publishing draft, parameters keywords, topN

Calling from Other Plugins

This plugin exposes data through the Cordis service toutiao. Other plugins can use it as follows:

const toutiao = ctx.get('toutiao');
const hot = await toutiao.getHot(10);
const res = await toutiao.search('羽绒服', 8);
const art = await toutiao.getArticle(gid);
const dig = await toutiao.getDigest({ top: 10 });
const draft = await toutiao.getDraft({ keywords: ['羽绒服'] });

HTTP Routes

The plugin provides routes under /api/plugins/dsh-toutiao. All routes go through DSH’s official access checks (Host-based DNS rebinding protection + Origin/cross-origin validation + browser token authentication). Common routes include:

  • GET /state: Configuration + status
  • POST /config: Save settings
  • POST /fetch-hot: Immediately fetch the trending list
  • POST /search: { keyword, limit }
  • POST /article: { id }
  • POST /draft: { keywords, topN }
  • GET /ui/panel.css: Panel styles

Configuration Options

Plugin configuration is persisted to $DSH_HOME/dsh-toutiao/config.json. Common configuration items are as follows:

Key Default Description
hotLimit 20 Default trending list size (1–50)
searchLimit 12 Default search result size (1–30)
keywords [] Default tracked keywords
digestTop 10 Number of top trending items covered by digest/draft
perKeyword 5 Results fetched per keyword
withFullText false Whether to attach full text to each result
autoDraft false Whether to auto-generate a draft after fetching
schedule.enabled false Whether scheduled fetching is enabled
schedule.intervalMinutes 60 Scheduling interval (minutes, 5–1440)

Use Cases & Cautions

This plugin is suitable for DSH users who need to aggregate Toutiao trending topics, search for content by specific keywords, or prepare material for content creation. The plugin runs with the current dsh process privileges; you should review the source code and license before installing. All collection targets publicly accessible pages and APIs. Usage is low-frequency, single-machine, and intended solely for aggregation and personal use. Please comply with the platform’s terms of service—do not perform high-frequency scraping or redistribute the data.

Conclusion

dsh-toutiao provides a complete workflow from trending list collection to draft generation, is callable by other plugins, and supports scheduled tasks. If you need to work with Toutiao-related data in DSH, refer to the plugin directory page and the GitHub repository for more information.

Plugin Directory Page
GitHub Repository

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye