SuperAPI AI Directory

web-importer

Office & productivity

View repository

Updated 10-16 09:52

About this skill

Web Importer — High-quality web page import to WPS Notes

Import web pages or WeChat Official Account articles directly into WPS Notes,preserving the original text colors, bold, heading inference, and blockquote highlight blocks, with images inserted at their positions. Now supports X/Twitter tweets and Threads: uniformly through web_fetch to get the currently visible content, and when image links are captured, insert them into the note at their original positions.


Core Principles

Do not write the fetched Markdown as-is into WPS Notes. The current entry point is web_fetch / web_search, and the fetched main content needs to be organized into WPS XML first before being written into the note; images are still inserted separately.

Correct path:

网页 URL
  ↓
web_fetch / web_search / batch_web_search
  ↓
网页正文 + 图片链接
  ↓
整理成 WPS XML
  ↓
create_note + batch_edit(正文 + 图片占位符写入 WPS)
  ↓
get_note_outline / read_blocks(找占位符)
  ↓
insert_image(逐张插图)

Quick Start

# 用户直接给 URL
web_fetch "https://mp.weixin.qq.com/s/xxxxx"
create_note
batch_edit
insert_image
sync_note

# 用户只给标题或模糊描述
web_search "文章标题或关键词"
ask_user(候选链接不唯一时)
web_fetch "确认后的 URL"
create_note
batch_edit
insert_image
sync_note

Comparison of the Two Modes

Direct Fetch Mode Search and Locate Mode
Entry User directly provides a URL User only provides a title / keywords
Get body content web_fetch web_search / batch_web_search + web_fetch
Output Write directly into WPS Notes Write directly into WPS Notes
Candidate confirmation Generally not needed When there are multiple candidates, use ask_user
Images insert_image Insert at position insert_image Insert at position
Read back for acceptance read_note / read_section / read_blocks read_note / read_section / read_blocks

X/Twitter Support Notes

X content may still be affected by dynamic rendering, login state, and thread expansion limitations. The current Skill uniformly relies on web_fetch the visible body text and image links returned, without additionally assuming browser rendering capabilities.

Workflow

X 推文 URL
  ↓
web_fetch 获取当前可见正文
  ↓
提取正文 + 图片链接
  ↓
整理成 WPS XML
  ↓
写入 WPS 笔记

Notes

Scenario Description
Public tweets Prioritize importing the currently visible body text
Tweets requiring login The body text may not be obtainable, and the user must be clearly informed
Long Threads Only import content that the current tool can reliably fetch
Video Only retain visible text and insertable images; the video itself is not guaranteed
Retweets / Quote tweets Based on the main content currently fetched

html_to_segments Parsing Logic

No longer relies on html_to_segments local scripts, but the processing goal remains unchanged: organize the web page structure into WPS XML, and preserve the original hierarchy and emphasis styles as much as possible.

Web Content → WPS XML Mapping

Web page structure / Markdown WPS XML
**加粗** / bold semantics <strong>
*斜体* / italic semantics <em>
Level 1 to Level 3 headings <h1> / <h2> / <h3>
Blockquote <blockquote>
Unordered / ordered lists <ul> / <li>
Table <table>
Link Preserve text and URL in the paragraph

Color mapping precision

If the scraping result can clearly preserve color semantics, it can be mapped to available styles in the WPS XML; if the scraping result has already lost color information, do not fabricate colors.

section flattening logic

When a web page has multiple levels of nesting, flatten it in final reading order into headings, body text, quotes, lists, tables, and image placeholders, then write it into WPS.


WPS write stability rules

Keep consistent with the stable write rules of existing note-editing tools; the key constraints are as follows:

正文优先用 batch_edit
少量修补可用 edit_block
图片只能用 insert_image
编辑前必须先拿到 block_id

anchor invalidation retry: Before inserting or supplementing an image, if the block_id has changed, first re- get_note_outline, and if necessary then read_blocks for precise positioning.

outline pagination: After importing a long article, if you need to go back and find image placeholders or supplement positions, first re-fetch the latest outline, then read in segments as needed.

prevent duplicate image insertion: When retrying, first read back the current note to confirm whether the image has already been inserted, avoiding duplicate writes.


Directory structure after download

The final output of the current Skill is a WPS note; there is no requirement to preserve the local download directory. After the import is complete, the note should contain at least:

笔记标题
来源信息(原网页链接)
正文结构(标题 / 段落 / 引用 / 列表 / 表格)
按位置插入的图片

WeChat Official Account title extraction priority

Try in order:

  1. web_fetch the page title returned by
  2. web_search the candidate title matched by
  3. The article title explicitly given by the user in the request
  4. If all of the above fail → use the link or "Untitled Article" as a fallback

Exception handling

Scenario Handling method
web_fetch Unable to scrape the body text Inform the user that the current link cannot be imported, and do not create an empty note
Incomplete body text Allow degraded import of the part that was scraped, and clearly state the missing content
Image download / insertion failed Skip that image, continue importing the body text, and report the number skipped
block_id invalid Re-fetch the outline and target block before continuing
Placeholder not found Read back the body text and relocate; if still not found, skip that image and explain
X/Twitter content not visible Inform the user that the current content cannot be publicly accessed or the thread is not fully expanded
Search results not unique Use ask_user to let the user confirm the link

Dependencies

Tool Purpose
web_fetch Scrape web page body text
web_search / batch_web_search Locate a web page when an exact link is missing
create_note Create the target note for import
get_note_outline Get block_id and the latest structure
batch_edit / edit_block Write the body text and small patches
insert_image Insert images by position
read_note / read_section / read_blocks Read back for acceptance
sync_note Sync after import
ask_user Confirm candidates when the link is unclear