A Chrome DevTools script to extract structured comment data from GitHub discussion threads.
- Navigate to a GitHub discussion page
- Open Chrome DevTools Console (
Cmd+Option+J
on Mac,Ctrl+Shift+J
on Windows) - Paste the extraction script
- Run it to get JSON structured data
See: ./gh-discussion-threads.js
interface GitHubDiscussionThread {
id: string; // GitHub internal ID (e.g., "DC_kwDOEfmk4M4Azg4f")
anchor: string; // URL anchor (e.g., "discussioncomment-13044518")
author: string; // GitHub username
timestamp: string; // ISO 8601 datetime
content: string; // Full comment text
reactions: string[]; // Emoji reactions with counts (e.g., ["π 6", "π 1"])
replies: Reply[]; // Nested replies
}
interface Reply {
id: string; // GitHub internal ID
anchor: string; // URL anchor
author: string; // GitHub username
timestamp: string; // ISO 8601 datetime
content: string; // Full reply text
}
{
"id": "DC_kwDOEfmk4M4Azg4f",
"anchor": "discussioncomment-13044518",
"author": "jhiesey",
"timestamp": "2025-09-19T17:01:13Z",
"content": "Is the replication feed down/blocked?...",
"reactions": ["π 6", "π 1"],
"replies": [
{
"id": "DC_kwDOEfmk4M4A3KH4",
"anchor": "discussioncomment-12647262",
"author": "michelleqyun",
"timestamp": "2025-09-19T17:04:34Z",
"content": "I'm seeing the same issue"
}
]
}
const discussionUrl = 'https://github.com/orgs/community/discussions/152515';
const directLink = `${discussionUrl}#${comment.anchor}`;