this basically an update that fixes the issue of extracting image urls from xcancel instance and it still only includes tweet urls by the main author/user.
Nc6v3.4-3 Bookmarklet: Detailed Summary for Nitter Instances
The bookmarklet, now named "Nc6v3.4-3," is a specialized tool designed to simplify the process of copying and formatting Twitter (or Nitter) threads into a BBCode format specifically tailored for forums, such as those powered by XenForo. It automates several complex tasks, significantly speeding up the sharing of tweet content, including text, images, and videos, while maintaining a particular structure for thread URLs.
1. Comprehensive Tweet Information Extraction
When activated on a Nitter (or Twitter) thread page, the bookmarklet meticulously scans each individual tweet within the visible thread to gather essential data:
*
Tweet URL Acquisition: It identifies the unique web address (URL) for every tweet in the thread. A crucial step here is the normalization of these URLs:
* It converts Nitter (
nitter.poast.org
) and certain other alternative front-end domains (
xcancel.com
) to the standard
twitter.com
domain. This ensures consistency and broad compatibility.
* It also removes any extraneous tracking parameters (like
?s=20
or
?ref_src=twsrc%5Etfw
) by splitting the URL at the first question mark, resulting in clean, direct tweet permalinks.
*
Tweet Author Identification: It accurately captures the username (e.g.,
@AuthorName
) of the individual who posted each tweet.
*
Tweet Text Processing: The bookmarklet extracts the full textual content of each tweet, performing smart conversions from the raw HTML:
* HTML line breaks (
<br>
) are transformed into forum-friendly newlines (
\n
).
* Any embedded web links (including those for mentions like
@username
or external URLs) are converted into proper BBCode
[URL][/URL]
tags, often wrapped in
[U][/U][/U] (underline) tags for visual emphasis on the forum.
* All other potentially problematic HTML tags ([icode]<p>[/p]
,
<span>[/span]
,
<div>[/div]
, etc.) are stripped away, preventing clutter and formatting issues on the forum.
* Non-breaking space characters (
) are replaced with standard spaces.
*
Image Handling: If a tweet includes images, the bookmarklet pinpoints their direct source URLs (typically from
pbs.twimg.com
). It then converts these into BBCode
[img][/img]
tags.
*
New in Nc6v3.4-3: It includes enhanced URL normalization for image paths. Specifically, if an image URL's path contains patterns like
/media/media/
(e.g.,
pbs.twimg.com/media/media/image.jpg
) or the more general
/media/ANYTHING/media/
(e.g.,
pbs.twimg.com/media/some_folder/media/image.jpg
), these redundant segments are replaced with a single
/media/
. This ensures the image links are robust and correctly display on forums.
*
Video Handling: For tweets containing videos, it attempts to locate the direct video source URL (usually originating from Twitter's video domains like
https://video.twimg.com/ext_tw_video/
or
https://video.twimg.com/amplify_video/
). These video URLs are also cleaned (query parameters removed) and presented as underlined
[U][URL][/URL][/U][/U] links.
[HR][/HR]
[SIZE=5][B]2. Structured Output and Conditional Spoilers[/B][/SIZE]
The bookmarklet doesn't simply dump all the extracted data; it structures it logically using BBCode, with a particular focus on "thread continued" spoilers for same-author tweets:
* [B]Main Tweet URL Display:[/B] The URL of the very first tweet in the thread, or the main tweet being viewed, is prominently displayed at the beginning of the output. This serves as the primary reference point.
* [B]"Thread Continued" Spoiler (Same Author):[/B] All *additional* tweet URLs in the thread that are from the *same author* as the main tweet are collected and placed inside a BBCode [icode][SPOILER="thread continued"][/SPOILER]
tag. This ensures that the initial post remains concise, while forum users can easily expand the spoiler to view the sequential URLs of the continuing conversation by the original poster. The URLs inside this spoiler maintain their original order as found on the webpage.
*
"Full Text & Large Images" Spoiler: The complete text content of *all* tweets in the thread, along with their associated
[img][/img]
(images) and
[URL][/URL][/U] (videos/links) tags, is encapsulated within a separate BBCode [icode][SPOILER="full text & large images"][/SPOILER]
tag. This provides access to all detailed tweet content without cluttering the initial forum post.
* Within this spoiler, each tweet's detailed content is clearly numbered (e.g.,
1/5
,
2/5
) and prefixed with the author's username (
@AuthorName
).
*
Chaining for Long Threads: To manage very long threads or those with numerous media elements (currently, if the cumulative image count reaches 20), the bookmarklet can intelligently divide the output into multiple self-contained "chains" or blocks. Each chain adheres to the established formatting pattern (main URL, thread continued spoiler, full text spoiler), making extensive threads more digestible on a forum.
*
Informational Link: A noticeable, colored BBCode link is included at the end of the "full text & large images" spoiler. This link directs users to a specific forum thread (
https://www.thecoli.com/threads/tips-and-tricks-for-posting-the-coli-megathread.984734/post-52211196[/URL][/CODE]) that offers further instructions and tips on how to effectively post tweets in this forum-specific format.
[HR][/HR]
[SIZE=5][B]3. Automation and User Feedback[/B][/SIZE]
After processing and formatting are complete, the bookmarklet automates the final steps for convenience:
* [B]Automatic Clipboard Copy:[/B] The entire generated BBCode output, including all formatted text and nested spoilers, is automatically copied to your system's clipboard. This eliminates the need for manual selection and copying.
* [B]Visual Confirmation:[/B] A small, temporary notification box appears in the bottom-left corner of your browser window (e.g., [icode]Copied: 7 tweets
), providing immediate visual feedback that the content has been successfully copied and indicating how many tweets were processed. This notification gracefully fades away after a few seconds.
*
Developer Console Messages: For debugging or informational purposes, the bookmarklet outputs messages to the browser's developer console (
console.log()
), including its specific version (
"Nc6v3.4-3"
) and a confirmation upon completion of the copying process.
In Essence:
The "Nc6v3.4-3" bookmarklet is a sophisticated utility for forum users who regularly share Twitter/Nitter content. It meticulously extracts all relevant data, applies robust formatting rules (including new image URL corrections), intelligently structures the output with conditional spoilers to maintain clarity and manage thread length, and automatically copies the result, significantly enhancing the efficiency and presentation quality of tweet sharing on XenForo-based forums. It prioritizes keeping the main tweet URL separate and placing only subsequent, same-author thread URLs into the "thread continued" spoiler.
pastebin.com/gTvWFKkV