/lmg/ Recap Script

Bookmarklet

javascript:document.querySelectorAll('span.quote').forEach(quoteSpan=>{const post=quoteSpan.parentNode;const previousThreadUrl=post.querySelector('a[href*="thread"]');let threadId=null;if(previousThreadUrl){const threadMatch=previousThreadUrl.href.match(/thread\/(\d{9})/);if(threadMatch)threadId=threadMatch[1];}const quoteIds=quoteSpan.textContent.match(/>(\d{9})/g);if(quoteIds){quoteSpan.outerHTML=quoteIds.map(id=>{const postId=id.slice(1);const linkUrl=threadId?`/g/thread/${threadId}#p${postId}`:`#p${postId}`;return `<a href="${linkUrl}" class="quotelink">>>${postId}</a>`;}).join(' ');}});

User Script

Direct Link

// ==UserScript==
// @name     4chan Linkify Greentext
// @version  1.1
// @include  http://boards.4chan.org/*
// @include  https://boards.4chan.org/*
// @include  http://www.4chan.org/*
// @include  https://www.4chan.org/*
// @grant    none
// @run-at   document-start
// ==/UserScript==
document.onreadystatechange = function () {
  if (document.readyState === "interactive") {
    document.querySelectorAll('span.quote').forEach(quoteSpan => {
        const post = quoteSpan.parentNode;
        const previousThreadUrl = post.querySelector('a[href*="thread"]');
        let threadId = null;
        if (previousThreadUrl) {
            const threadMatch = previousThreadUrl.href.match(/thread\/(\d{9})/);
            if (threadMatch) threadId = threadMatch[1];
        }
        const quoteIds = quoteSpan.textContent.match(/>(\d{9})/g);
        if (quoteIds) {
            quoteSpan.outerHTML = quoteIds.map(id => {
                const postId = id.slice(1);
                const linkUrl = threadId ? `/g/thread/${threadId}#p${postId}` : `#p${postId}`;
                return `<a href="${linkUrl}" class="quotelink">>>${postId}</a>`;
            }).join(' ');
        }
    });
  }
};

F.A.Q.

Why?

Since Friday September 20th, posts with more than 9 replies are rejected as spam.
Links have been replaced with greentext in the recap to avoid mass-replying while still providing sources. Those who find the recaps useful can use this script to restore link functionality.

4chan-x? Post Previews? (You)s?

Everything should just work on GreaseMonkey, TamperMonkey, and ViolentMonkey.

Edit
Pub: 25 Sep 2024 11:04 UTC
Edit: 21 Jul 2025 22:49 UTC
Views: 6187