NutritionFacts | Markdown Transcript/Comments Export

Export video transcripts and Disqus comments as Markdown. Click to copy, Shift+Click to download, Hold+Drag to drag text.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

लेखक
piknockyou
दैनिक इंस्टॉल
0
एकूण इंस्टॉल
0
रेटिंग
0 0 0
आवृत्ती
2.5
बनवली
2026-01-22
अपडेट केली
2026-01-22
आकार
49.1 KB
License
AGPL-3.0
यांवर लागू होते:

If you'd like to support me: https://ko-fi.com/piknockyou :-)

See screenshots at the bottom

NutritionFacts.org | Markdown Export (Transcript & Comments)

Adds a floating toolbar to NutritionFacts.org video pages for exporting transcripts and Disqus comments as clean, well-structured Markdown. Features one-click copy, Shift+click download, drag-and-drop text transfer, and a minimizable interface.


Why You Need This

Extracting content from NutritionFacts.org for research or note-taking is tedious:

  • Transcripts require manual copy-paste, losing formatting
  • Disqus comments are buried in an iframe with no export option
  • Threaded replies lose their hierarchical structure when copied
  • Combining both means juggling multiple windows and formats

This script gives you one-click Markdown export with proper formatting, nested comment threads, and metadata—ready for Obsidian, Notion, or any Markdown editor.


Features

Transcript Export

  • Extracts full video transcript with proper paragraph breaks
  • Automatically removes boilerplate (approximation notices, volunteer callouts)
  • Includes video title and source URL as metadata header

Comments Export

  • Captures all Disqus comments including deeply nested reply threads
  • Preserves thread hierarchy using Markdown nested lists
  • Includes author names and dates for each comment
  • Sorted chronologically (oldest first)

Three Interaction Modes

Action Result
Click Copy content to clipboard
Shift+Click Download as .md file
Hold+Drag Drag text directly into any application

Hold the button for ~300ms before dragging to activate drag mode.

Export Options

Button Output
Transcript Video transcript only
Comments Disqus comments only
Both Transcript + separator + comments combined

Minimizable Interface

  • Minimize: Click the button to collapse to a small icon
  • Expand: Click the minimized icon to restore
  • Reposition: Right-click and drag to move anywhere on screen
  • Persistent: Position and minimize state saved across sessions
  • Help: Hover over ? icon for interaction guide

Output Format

Transcript Markdown

# Video Title Here
- **Link:** https://nutritionfacts.org/video/...

---

First paragraph of transcript text here.

Second paragraph continues here...

Comments Markdown

# Video Title Here
- **Link:** [View Video](https://nutritionfacts.org/video/...)
- **Date:** 6/14/2025, 10:30:00 AM
- **Comments:** 42

---

1. **AuthorName** [1/15/2024]
   This is a root-level comment with
   multiple lines preserved.

    - **ReplyAuthor** [1/16/2024]
      This is a reply to the first comment.

        - **NestedReply** [1/17/2024]
          Replies can nest multiple levels deep.

2. **AnotherUser** [2/1/2024]
   Second root comment here.

Downloaded Filename Format

Video Title_transcript.md / Video Title_comments.md / Video Title_both.md


Usage

Quick Actions

Action Result
Click Copy to clipboard
Shift+Click Download as .md file
Hold (~300ms) + Drag Drag text to another app
Right-click + Drag Reposition the panel
Click Minimize to icon
Click minimized icon Expand panel
Hover ? Show interaction guide

First-Time Comment Export

  1. Scroll down until the Disqus comment section loads
  2. Click Comments or Both button
  3. Wait for "Loading..." to complete
  4. Content is copied and cached for instant future access

After first load, comments are cached—subsequent clicks/drags are instant.

Visual Feedback

State Appearance
Ready Teal gradient button
Loading Spinner icon + "Loading..." text
Copied Green button + checkmark + "Copied!"
Downloaded Green button + checkmark + "Downloaded!"
Failed Red button + X icon + "Failed"
Dragging Semi-transparent button

Installation

Requirements

Steps

  1. Install a userscript manager
  2. Install this script
  3. Visit any NutritionFacts.org video page
  4. The floating panel appears in the corner

How It Works

Transcript Extraction

  1. Locates the #transcript tab panel element
  2. Clones and cleans the DOM (removes boilerplate paragraphs)
  3. Formats as Markdown with title and URL header

Comment Extraction

  1. Communicates with the Disqus iframe via postMessage
  2. Parses the embedded #disqus-threadData JSON
  3. Recursively builds threaded Markdown from parent-child relationships
  4. Caches result for instant subsequent access

Panel Positioning

  • Stores position as viewport ratio (adapts to window resize)
  • Anchors to top or bottom edge based on vertical position
  • Persists via userscript storage (GM_setValue/GM_getValue)

Dynamic Tooltip Positioning

  • Help tooltip automatically repositions based on available viewport space
  • Never clips outside viewport edges
  • Maintains distance from mouse pointer

Drag Isolation

  • Full-screen overlay during panel repositioning
  • Prevents accidental hover interactions with page elements

Technical Details

  • No external dependencies: Uses only browser APIs and userscript grants
  • SPA compatible: Works with NutritionFacts.org navigation
  • Cross-frame communication: Secure postMessage to Disqus iframe
  • Drag API: Native HTML5 drag-and-drop with custom drag image
  • Viewport-aware UI: Tooltip dynamically repositions to stay visible

FAQ

Q: The Comments button says "Loading..." but nothing happens.
A: Scroll down until you see the Disqus comment section load, then try again. The iframe must be present.

Q: Can I drag text into Word/Google Docs?
A: Yes! Hold the button for ~300ms, then drag directly into any application that accepts text drops.

Q: Why does the panel position change on window resize?
A: The position is stored as a ratio of the viewport, so it stays in the same relative location regardless of window size.

Q: Comments aren't showing the full thread.
A: The script captures whatever Disqus has loaded. Very long threads with "Load more" buttons may require scrolling through comments first.

Q: Can I customize the Markdown format?
A: The format is optimized for readability in standard Markdown renderers. Modify generateFormattedOutput() in the script for custom formatting.

Q: Where is my panel position saved?
A: Position and minimize state are stored via userscript storage (GM_setValue), which persists across browser sessions and is isolated from website data.