Install this Userscript/Addon to improve your browsing experience on TheColi... view more embeds.

bnew

Veteran
Joined
Nov 1, 2015
Messages
56,014
Reputation
8,229
Daps
157,686
* this was created with AI / LLM DeepSeek coder 2 and llama3-70B-instruct
posting this here because I just realized the other scripts i posted are only accessible to registered members and there are thousands of people who visit the site who wouldn't have access to it otherwise.


Whats a Userscript?​

A userscript is a small computer program that is designed to customize the way web pages are displayed or function in a web browser. Userscripts are typically written in JavaScript and can be used to modify the appearance, behavior, or functionality of websites. Users can install userscripts in their web browsers using add-ons or extensions such as Greasemonkey or Tampermonkey. This allows users to personalize their browsing experience and add new features to websites.

what does this userscript do?​


This userscript is designed to enhance the functionality of thecoli.com. It performs several tasks:

1. **Embedding Social Media Posts**: It embeds posts from various social media platforms such as X (formerly Twitter), Threads.net, Mastodon, and Bluesky directly into the forum posts. This is done by detecting URLs from these platforms in forum posts and replacing them with embedded iframes that display the content directly.

2. **Add Twitter/X mirror **: The script adds links to a Twitter a twitter mirror called Twstalker. This comes in handy if you don't have an account to view content marked sensitive. so if you ever see an embed thatdoesn't load, don't always assume the content, click the twstalker link to see if it's still up.


3. **URL Replacement and Enhancement**: The script also handles the replacement of certain URLs with more user-friendly versions. For example, it replaces `x.com` URLs with `twitter.com` URLs and enhances image URLs from certain domains to point to more direct links.

4. **Dynamic Content Handling**: Fix links to Twitter images (twimg.com) so they display correctly.
Fix links to Reddit images so they display correctly.


**Layman's Terms Summary**: This script makes forum posts on certain websites more interactive by showing social media posts directly within the forum instead of as links. It also makes sure that the display of these posts adjusts automatically to fit the content, and it improves how links and images are displayed to make them easier to view.

userscript in action:
X.com link turned into an embed
SWRPoEv.png







To use user scripts you need to first install a user script manager. Here are managers for various browsers:​

*GM is short for GreaseMonkey
  • Greasemonkey - Firefox
  • Supports GM 4 userscripts.
  • Greasemonkey for Pale Moon - Pale Moon
  • Supports GM 3 userscripts.
  • Firemonkey - Firefox
  • Supports GM 4 userscripts and some GM 3 userscripts.
  • Tampermonkey - Chrome, Microsoft Edge, Safari, Opera, Firefox (also with support for mobile Dolphin Browser and UC Browser)
  • Supports both GM 3 and GM 4 userscripts.
  • USI - Firefox
  • Supports some GM 3 userscripts.
  • Violentmonkey - Chrome, Firefox, Maxthon, Opera
  • Supports both GM 3 and GM 4 userscripts.

The most popular userscript managers are Greasemonkey, Tampermonkey, and Violentmonkey.

Install Tampermonkey

The Userscript:​


adds mirror invidious links for youtube embeds, added extra archive.is save link for xcancel.com Nitter instance.



bug fix for bluesky embeds that didn't adjust height of content properly. added mirror links under twitter/X embed.


old version 9/9/24

fixed bluesky / bsky post embeds,

old version 6/25/24


I had to update the script since it was converting [URL unfurl="true"]https://www.tiktok.com/t/ZPRERxvTg/[/URL] into mastodon embeds that wouldn't load because it wasn't design for that.
edited line 18: const mastodonRegex = /^https?:\/\/(?!www\.tiktok\.com)([a-z\d-_]+\.)*([a-z\d-_]+)\.([a-z]{2,})(\/@[a-zA-Z0-9-_]+(@[a-zA-Z0-9-_]+)?\/\d+|\/@[a-zA-Z0-9-_]+\/post\/\w+|\/t\/\w+)/;





copy this link https://pastebin.com /raw/Q8KEDLZf ( remove the space between / and /raw/) and paste it into the Import from URL field in tampermonkey -> Utilities tab


l6AQwzU.png


click install
O93XIDm.png


don't forget to enable tampermonkey or any userscript manager extension to work in incognito/private mode
sADwr0f.png



You can use the Firefox browser or Fennec browser on android or any firefox browser fork with the extension tampermonkey.

Kiwi Browser for Android support userscripts through extensions like Tampermonkey or Violentmonkey.

there are other mobile browsers that support userscripts natively.


heres how to install on iOS.















Brave browser and Chrome browser on mobile do not support userscripts or extensions.



**Important Notice Regarding Threads.net Embeds and Rate Limiting**

Users of the "X, Threads.net and Mastodon Embed and more" user script should be aware of potential limitations when attempting to embed content from Threads.net into forums on sites like `Sports, Hip Hop & Piff - The Coli`. META, the platform that hosts Threads.net, employs aggressive rate limiting to manage server load and ensure a fair distribution of resources. While the script includes throttling mechanisms to manage the frequency of requests, these may not be sufficient to prevent triggering META's rate limiting thresholds.

To help mitigate the risk of being rate-limited by META, users can adjust the throttling settings within the script to make fewer requests to Threads.net. Here's how you can modify the throttling settings specifically for the `adjustIframeHeights` function:

1. **Locate the Throttling Configuration**: Open the userscript file in a text editor or tampermonkey. Scroll down to the section where the `adjustIframeHeights` function is defined. You will find the following lines of code:


2. **Adjust the Throttle Limit**: The `throttle` function is used to limit the frequency of the `adjustIframeHeights` function. The second parameter, `25000`, specifies the delay in milliseconds before the function can be called again. To reduce the number of requests, increase this delay. For example, you might change `25000` to `50000` to allow the function to run at most once every 50 seconds.

3. **Modify the Interval Time**: The `setInterval` function is used to periodically call the `throttledAdjustIframeHeights` function. The second parameter, `65000`, specifies the interval in milliseconds between each call. To further reduce the frequency of requests, increase this interval. For instance, you could change `65000` to `120000` to check for height adjustments every 2 minutes.

4. **Apply the Changes**: After modifying the throttling and interval settings, save the changes to the script file. Reload the webpage to apply the new settings and observe if the rate limiting issues have been resolved or improved.

5. **Monitor Performance**: Keep an eye on the script's performance and the console for any error messages. If you continue to encounter rate limiting issues, you may need to further increase the throttling settings or consider other strategies to reduce the load on Threads.net's servers.

Please note that adjusting the throttling settings may affect the responsiveness and functionality of threads.net embeds. It is important to find a balance that allows for smooth operation without overwhelming the server.
[/size][/spoiler][/spoiler]
 
Last edited:

bnew

Veteran
Joined
Nov 1, 2015
Messages
56,014
Reputation
8,229
Daps
157,686
the site not letting me post a raw pastebin link :francis:

edit:
might make this a work in progress post

what the userscript makes some x.com , threads.net and bluesky links look like:
 
Last edited:

bnew

Veteran
Joined
Nov 1, 2015
Messages
56,014
Reputation
8,229
Daps
157,686
Embed random things on your device from coli brehs, brehs. And @bnew is the homie but still.


the great thing about AI is you don't have to take anyones word for anything.

bhXQkLi.png



This is a UserScript, a type of script that can be run in a web browser to modify the behavior of a website. Specifically, this script appears to be designed to work on the website "thecoli.com", which is a forum platform.

The script's main purpose is to embed social media posts from various platforms (Twitter, Threads.net, Mastodon, and Bluesky) into the forum threads, making it easier for users to view and interact with the content without leaving the forum.

Here's a breakdown of what the script does:

1. It defines regular expressions to match URLs from each of the supported social media platforms.
2. It creates functions to generate iframes for each platform, which will be used to embed the social media posts.
3. It defines a `replaceLinks` function that searches for links to social media posts on the page and replaces them with the corresponding iframes.
4. It defines a `fit` function that adjusts the size of the iframes to fit the content.
5. It defines an `addTwstalkerLinks` function that adds links to Twstalker, a Twitter analytics tool, next to Twitter iframes.
6. It defines a `convertXcomLinks` function that converts x.com URLs to Twitter.com URLs and replaces them with iframes.

The script is not nefarious in any way. It appears to be a legitimate script designed to enhance the user experience on the thecoli.com forum by making it easier to view and interact with social media content. However, as with any script, it's always a good idea to review the code and ensure it's not doing anything malicious or unwanted.
 

Fillerguy

Veteran
Joined
May 5, 2012
Messages
18,542
Reputation
4,195
Daps
77,236
Reppin
North Jersey
* this was created with AI / LLM DeepSeek coder 2 and llama3-70B-instruct
posting this here because I just realized the otehr scripts i posted are only accessible to registered members and there are thousands of people who visit the site who wouldn't have access to it otherwise.

:patrice:Who side you on?
 
Joined
Apr 3, 2014
Messages
71,910
Reputation
17,058
Daps
305,987
the great thing about AI is you don't have to take anyones word for anything.

bhXQkLi.png



This is a UserScript, a type of script that can be run in a web browser to modify the behavior of a website. Specifically, this script appears to be designed to work on the website "thecoli.com", which is a forum platform.

The script's main purpose is to embed social media posts from various platforms (Twitter, Threads.net, Mastodon, and Bluesky) into the forum threads, making it easier for users to view and interact with the content without leaving the forum.

Here's a breakdown of what the script does:

1. It defines regular expressions to match URLs from each of the supported social media platforms.
2. It creates functions to generate iframes for each platform, which will be used to embed the social media posts.
3. It defines a `replaceLinks` function that searches for links to social media posts on the page and replaces them with the corresponding iframes.
4. It defines a `fit` function that adjusts the size of the iframes to fit the content.
5. It defines an `addTwstalkerLinks` function that adds links to Twstalker, a Twitter analytics tool, next to Twitter iframes.
6. It defines a `convertXcomLinks` function that converts x.com URLs to Twitter.com URLs and replaces them with iframes.

The script is not nefarious in any way. It appears to be a legitimate script designed to enhance the user experience on the thecoli.com forum by making it easier to view and interact with social media content. However, as with any script, it's always a good idea to review the code and ensure it's not doing anything malicious or unwanted.





Well... sounds good but I hope you don't mind if I try it in a VM before putting it on my main OS :mjpls:
 
Top