ナビゲーションにスキップ

How do I turn saved WeChat articles into RSS without fetching every body again?

To turn saved WeChat articles into RSS, put the verified article source records in records/, run generate_rss.py to build a local RSS 2.0 feed.xml with original links, then host feed.xml at an address you control and confirm that your reader receives a new item. Rebuilding feed.xml from saved records needs no new body query; wechat_mp.v2.fetch_article_detail_h5 is called only for articles that have no saved body yet. For example, you want to read several peer companies’ WeChat articles in one reader instead of visiting every account daily. Generating feed.xml is only the first of three stages: generation, hosting and reader fetching each need their own check.

Each item in feed.xml carries an excerpt of the first 500 body characters, which helps you decide whether to open the original. The excerpt is neither an AI summary nor full text.

Choose the reading scope before making more requests

For example, when you follow product announcements from three peers, select the relevant accounts and topics, exclude unrelated material and record each article’s source and reading goal. Put the selected source JSON files in records/: the contents of records/ define the feed’s scope. generate_rss.py does not discover accounts, classify topics or judge reading value.

If you only need titles and original links, do not pay for every body. generate_rss.py accepts only source records verified by the body-reading guide (step 1). generate_rss.py has no adapter for account-list excerpts, and an account-list excerpt must not be relabeled as full body text to fit the input. For excerpt-only material, use the listing-excerpt workflow linked at the end of this page and record the adapter gap.

Interpret what appears in the reader

ObservationInterpretationNext step
Relevant title but no answer in the excerptThe excerpt covers only the opening; the full article may answer the questionOpen the original or the saved body and continue with your question
Publication date absentThe source has no publication time; generation time is not a substituteKeep the date missing; do not label the item as published today
An article appears twiceAlias URLs, or different GUIDs in the old and new feedsCheck the links and the reader’s actual behavior; do not delete by title
An older item disappears after regenerationgenerate_rss.py rebuilds the complete file, and the scope of records/ may have changedCheck records/ and the previous feed before concluding that the author deleted the article
No new item in the readerDiscovery, generation, hosting or reader fetching may be incompleteTrace the specific article link through each stage before another data query

generate_rss.py keeps no historical database: to keep an item in the feed, keep the item’s source record in records/. Updated content at the same URL keeps the same GUID. Update notices and read-state behavior can only be confirmed by testing in a real reader. Item order in feed.xml is not publication-date order.

Verify one actual update from source to reader

  1. Generate feed.xml from a few saved records and parse the XML. Check titles, original links, excerpts and dates.

  2. Host feed.xml at a test address you control and confirm that the reader can open the address. A local path is not a subscription address for a remote reader. Check private access separately, and keep keys out of the feed.

  3. Add one confirmed new source record, regenerate feed.xml, update the same test address and refresh the reader.

  4. Check that the expected article appears once and opens the correct original.

Keep evidence from each stage: XML generation, hosting and reader fetching are accepted separately. The generator is in steps 1–3 below; hosting, scheduling and the reader connection are yours to set up.

When migrating from wewe-rss, keep the old subscriptions and material, and trial one account first. The wewe-rss repository was archived on May 11, 2026. The status explanations quoted in section 7 come from the wewe-rss README; the README does not establish ongoing maintenance or the cause of your current failure. Repository and README

For example, Wednesday’s records/ folder includes “Installation manual update,” but the reader does not show the article:

  1. Look for the article’s original link in the generated feed.xml.
  2. If the link is in feed.xml, check the XML served at the subscription URL.
  3. If the served feed also contains the link, check the reader’s refresh time and the guid the reader recorded.

All three checks reuse the body you already saved.

1. Prepare valid source records

Create wechat-article-source.json for each article with the reading guide. Copy the approved records into records/ under distinct file names, keeping article_url, title, text, published_at_utc and collected_at. The contents of records/ define the feed’s scope; do not put keys or billing logs in records/.

If an article still needs a body, inspect data:wechat_mp.v2.fetch_article_detail_h5 first:

curl -sS https://api.beatapi.io/v1/capabilities/inspect \
-H 'Content-Type: application/json' \
-d '{"reference":"data:wechat_mp.v2.fetch_article_detail_h5"}'
curl -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"wechat_mp.v2.fetch_article_detail_h5","params":{"url":"<article_url>"}}' \
-o wechat-article.json

2. Generate XML

generate_rss.py reads local files only, keeps one item per exact URL and escapes text with an XML library. description holds the first 500 body characters, not the complete text. When published_at_utc exists, generate_rss.py writes pubDate in RFC format in GMT. A missing publication time stays absent; collected_at is never used as the publication time.

import html
import json
import tempfile
import xml.etree.ElementTree as ET
from datetime import datetime, timezone
from email.utils import format_datetime
from pathlib import Path
from urllib.parse import parse_qs, urlsplit
def timestamp(value, label):
if value is None or value == "":
return None
if not isinstance(value, str):
raise SystemExit(f"Invalid {label}")
try:
parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
except ValueError:
raise SystemExit(f"Invalid {label}")
if parsed.tzinfo is None:
raise SystemExit(f"Timezone required for {label}")
return parsed.astimezone(timezone.utc)
records = {}
for file in sorted(Path("records").glob("*.json")):
record = json.loads(file.read_text(encoding="utf-8"))
url = record.get("article_url")
text = record.get("text")
parsed = urlsplit(url) if isinstance(url, str) else None
if not parsed or parsed.scheme not in {"http", "https"} or parsed.hostname != "mp.weixin.qq.com" or parsed.username:
raise SystemExit(f"Invalid article URL in {file.name}")
query = parse_qs(parsed.query)
if not ((parsed.path == "/s" and all(query.get(key) for key in ["__biz", "mid", "idx"])) or (parsed.path.startswith("/s/") and parsed.path[3:].strip())):
raise SystemExit(f"Missing article identifier in {file.name}")
if not isinstance(text, str) or not text.strip() or text.strip() in {"[redacted]", "[redacted-depth]"}:
raise SystemExit(f"Missing body in {file.name}")
title = record.get("title") or "Untitled article"
if not isinstance(title, str):
raise SystemExit(f"Invalid title in {file.name}")
published = timestamp(record.get("published_at_utc"), "published_at_utc")
collected = timestamp(record.get("collected_at"), "collected_at")
candidate = (title, text, published, collected)
previous = records.get(url)
if previous:
if previous[:3] == candidate[:3]:
if collected and (not previous[3] or collected > previous[3]):
records[url] = candidate
continue
if not collected or not previous[3] or collected == previous[3]:
raise SystemExit(f"Conflicting observations need distinct collected_at: {file.name}")
if collected < previous[3]:
continue
records[url] = candidate
if not records:
raise SystemExit("No article records; keep the previous feed unchanged.")
root = ET.Element("rss", version="2.0")
channel = ET.SubElement(root, "channel")
ET.SubElement(channel, "title").text = "Saved WeChat articles"
ET.SubElement(channel, "link").text = "https://mp.weixin.qq.com/"
ET.SubElement(channel, "description").text = "Selected article excerpts with original sources."
for url, (title, text, published, collected) in records.items():
item = ET.SubElement(channel, "item")
ET.SubElement(item, "title").text = title
ET.SubElement(item, "link").text = url
ET.SubElement(item, "guid", isPermaLink="true").text = url
ET.SubElement(item, "description").text = html.escape(text[:500])
if published:
ET.SubElement(item, "pubDate").text = format_datetime(published, usegmt=True)
target = Path("feed.xml")
with tempfile.NamedTemporaryFile(dir=target.parent, suffix=".xml", delete=False) as handle:
temporary = Path(handle.name)
try:
ET.ElementTree(root).write(temporary, encoding="utf-8", xml_declaration=True)
ET.parse(temporary)
temporary.replace(target)
finally:
temporary.unlink(missing_ok=True)
print(f"Wrote {len(records)} items")

Save the code as generate_rss.py next to records/, then run:

python3 generate_rss.py
python3 -c 'import xml.etree.ElementTree as E; r=E.parse("feed.xml"); print("items:", len(r.findall("channel/item")))'

3. Verify output and duplicate behavior

  • Repeated exact URLs produce one item.
  • For changed content at the same URL, the record with the later timezone-aware collected_at wins, regardless of file name. If observation times are missing or equal and the content conflicts, generate_rss.py fails and keeps the previous feed.
  • Identical content collapses into one item even without observation times. Matching titles with different URLs stay separate items.
  • Short and long alias URLs need separate identity verification.
  • File-name order in records/ is not publication-time order.

generate_rss.py parses the temporary XML before replacing the target file, so missing data, empty input or invalid XML never publishes an empty feed. Keep the source records for regeneration. The RSS 2.0 specification lists the required channel elements and guid semantics.

4. Host the feed and test the reader separately

A local feed.xml is not a public service. Decide whether the excerpts are private or redistributable, host the file on a service you control, then test access, encoding and refresh behavior in the actual reader. Do not publish full articles, logs or sensitive records without the rights to do so.

5. Add new articles to the feed

  1. Use incremental checks to discover candidate articles.
  2. Retrieve bodies only for the candidates that need a body, and add the new records to records/.
  3. Regenerate feed.xml.

Scheduling and hosting each need their own configuration. A successful generate_rss.py run does not show that a reader has fetched the update.

6. Costs and verification scope

Generating RSS from saved records makes no BeatAPI call. New article bodies and list pages are billed separately at the current prices shown by Inspect. generate_rss.py handles XML escaping, exact-URL deduplication, latest-observation selection via collected_at, GMT pubDate formatting, and preserving the existing feed.xml when input is invalid or empty.

7. Recover or migrate a failing wewe-rss installation

Before deleting the old service, decide whether collection or feed delivery failed. The wewe-rss README defines an invalid account as an expired login and the “today’s little black room” status as an account restriction. The README also documents PLATFORM_URL, CRON_EXPRESSION, and UPDATE_DELAY_TIME. Use the table below to choose the first check for each symptom.

SymptomFirst checkWhat the symptom does not establish
Account marked invalidSign in again in the old service, then test one account for new articlesNot an RSS formatting error, and not proof that every account is affected
Account restriction statusFollow the wewe-rss waiting guidance, reduce update frequency and keep the last good feedClearing the local status by restarting does not lift a platform restriction; do not retry in a loop
New articles in the dashboard but not the readerCompare the latest dashboard article URL, the served feed XML and the reader’s fetch time; check URL, access and cachingNot necessarily a collection API failure
Every account stops updatingCheck that the configured PLATFORM_URL is reachable from the deployment server, then check job logs and schedulingDoes not establish that the PLATFORM_URL relay is down or returns 502

BeatAPI replaces on-demand article retrieval only; the account database, OPML, scheduler, hosting and reader synchronization stay with your own setup. Article-detail retrieval uses the article URL and your BeatAPI key; generate_rss.py does not need WeRead cookies or a password.

Migrate one account before changing every subscription

  1. Export OPML from the old service, and back up the old service’s database, old feed XML and configuration with the installation’s existing procedures. Keep the backups private, and never put credentials into records/. OPML keeps subscription listings, not article bodies or read status.
  2. Select one independently identified account and leave the account’s old subscription in place. Generate a separate feed.xml from saved source records without replacing the old URL. Existing records need no new paid calls; retrieve missing bodies one by one with the source guide. The old wewe-rss database is not valid input to generate_rss.py.
  3. Compare two historical articles and one confirmed new article by original URL, old guid, new guid, title and publication time. generate_rss.py uses the full article_url as guid; the old service may use a different guid for the same link. Only a test in the actual reader shows duplicate and read-status behavior. generate_rss.py cannot import old guid values or read status.
  4. Host the new feed.xml at a test subscription URL you control and add the URL to one reader. Check titles, Chinese characters, excerpts, original links and publication dates; collection time must not replace publication time. Add one more source record, regenerate, update the hosted file and refresh the reader to confirm that only the expected new item appears.
  5. After the trial account passes, choose whether to replace the old subscription or keep the new address. Record the cutover time, the last successful article and the coverage. If the cutover fails, restore the backed-up feed and subscription configuration; do not clear history or keep buying collection attempts. Migrate the remaining accounts one at a time.

generate_rss.py produces excerpt-only RSS 2.0; generate_rss.py does not reproduce the old service’s fulltext, Atom or JSON modes. Subscription filters, private access, attachments, read status and automatic OPML migration each need separate implementation and acceptance.

Budget and evidence of recovery

Estimate data cost as list requests × current list price + new body requests × current body price. Rebuilding local RSS makes zero platform calls. For example, checking only the first page of 30 accounts daily for 30 days is 900 list requests, before pagination, bodies and other operations. Do not substitute another provider’s monthly price or failure-billing policy. Hosting, scheduling, notifications and model costs are separate.

A continuous subscription is restored only when you have evidence for all four steps: new source record → generated XML → updated hosting → new item fetched by the reader.

Source-field definitions · Question index

Replace an existing subscription with a sourced article feed

If an old feed stops updating, keep the account list, the seen URLs and the exports. Find new material with incremental article collection and generate RSS with steps 1–3 above. Test one update at a reachable feed URL in your reader, then carry the saved state into the new workflow. If you are investigating an abnormal old deployment, keep the operational evidence and follow your incident process; article migration can use the saved sources.

Check RSS support and filters in your installed TrendRadar or other aggregator. For Xiaohongshu, collect candidates with the note search exporter and confirm links, titles and dates before adding the Xiaohongshu items to a separate feed. Check one update from each source.

Add two feeds to TrendRadar

Build an RSS feed from listing excerpts and trial the migration