domain-skills: add Discord channel scraping - #545
Open
alexandme wants to merge 1 commit into
Open
Conversation
…preview trap, pins)
✅ Skill review passedReviewed 1 file(s) — no findings. |
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="domain-skills/discord/scraping.md">
<violation number="1" location="domain-skills/discord/scraping.md:40">
P2: The documented extraction shape can emit every reply without its parent relationship because `replyTo` has no selector or extraction step, while the only reply-specific node is discarded for text extraction. Capturing the parent id from the `repliedMessage` preview before excluding it would make the advertised field usable.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
|
||
| ## Extraction loop shape | ||
|
|
||
| Per pass: collect `{id, author, time, text, replyTo, links, embeds, reactions}` for every `li`, merge into a dict keyed by id, scroll top, sleep ~1.5s, repeat until start marker + zero new ids. A ~25-message channel takes 2–3 passes at a full-height viewport. |
Contributor
There was a problem hiding this comment.
P2: The documented extraction shape can emit every reply without its parent relationship because replyTo has no selector or extraction step, while the only reply-specific node is discarded for text extraction. Capturing the parent id from the repliedMessage preview before excluding it would make the advertised field usable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/discord/scraping.md, line 40:
<comment>The documented extraction shape can emit every reply without its parent relationship because `replyTo` has no selector or extraction step, while the only reply-specific node is discarded for text extraction. Capturing the parent id from the `repliedMessage` preview before excluding it would make the advertised field usable.</comment>
<file context>
@@ -0,0 +1,44 @@
+
+## Extraction loop shape
+
+Per pass: collect `{id, author, time, text, replyTo, links, embeds, reactions}` for every `li`, merge into a dict keyed by id, scroll top, sleep ~1.5s, repeat until start marker + zero new ids. A ~25-message channel takes 2–3 passes at a full-height viewport.
+
+## Pinned messages
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
domain-skills/discord/scraping.md— reading full message history from a Discord channel via the logged-in web app.Field-tested learnings captured
li[id^="chat-messages-"]ids (snowflakes → chronological sort across batches).div[id^="message-content-"]— a barequerySelectorsilently scrapes the quoted text instead of the reply body. Fix: filter out nodes insidediv[class*="repliedMessage"].h3author header — forward-fill after sorting.h3innerText concatenates username + server tag + timestamp tooltip; usespan[class*="username"]only.time[datetime]absolute timestamps, embeds viaarticle, reactions viaimgalt, pinned-messages popout.All selectors are attribute/class-prefix based (Discord's class names are hashed but prefixes are stable); no pixel coordinates, no user-specific state.
Summary by cubic
Add a new guide for scraping full Discord channel history through the logged-in web app, no API token required. It explains scroll-and-merge extraction with stable selectors and covers common traps and pins.
domain-skills/discord/scraping.md.ol[data-list-id],li[id^="chat-messages-"]) and scroller.time[datetime], embeds viaarticle, reactions fromimg[alt].h3, edited-text suffix.messagesPopoutcontent.Written for commit e476899. Summary will update on new commits.