General Elon Musk Fukkery Thread

Macallik86

Superstar
Supporter
Joined
Dec 4, 2016
Messages
6,495
Reputation
1,372
Daps
21,204
I guess we will need a site update to embed Mastodon and eventually threads...
📠
Looking forward to the Mastodon embeds
5z0O6KU.png

I'm down to one working instance on Nitter but I think I'll hold off on threads until something similar is created. I'm thinking/hoping it'll be a lot easier to create w/ ActivityPub running it 🤔
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
55,678
Reputation
8,224
Daps
157,178
DuLmeYf.png

 

bnew

Veteran
Joined
Nov 1, 2015
Messages
55,678
Reputation
8,224
Daps
157,178
📠
Looking forward to the Mastodon embeds

I'm down to one working instance on Nitter but I think I'll hold off on threads until something similar is created. I'm thinking/hoping it'll be a lot easier to create w/ ActivityPub running it 🤔

i've been using a userscript to view mastodon links as embeds on the coli. the only issue is it doesn't dynamically resize.

I got chatgpt to make a userscript that would load mastodon links like twitter posts.

it basically determines if a link is a mastodon link based on the @Username and post id. it's then add to the end /embed.js for each mastodon instance link with it's unique domain.

Code:
// ==UserScript==
// @name         Mastodon Embed Links
// @version      1
// @description  Embed Mastodon posts in Xenforo-compatible forums
// @match        https://www.thecoli.com/threads/*
// @match        https://thecoli.com/threads/*
// ==/UserScript==

(function() {
    'use strict';

    // Regex pattern to match Mastodon links
    const mastodonRegex = /^https?:\/\/([a-z\d-_]+\.)*([a-z\d-_]+)\.([a-z]{2,})(\/@[a-zA-Z0-9-_]+\/\d+)/;

    // Find all links on the page
    const links = document.getElementsByTagName("a");
    for (let i = 0; i < links.length; i++) {
        const link = links[i];
        const href = link.getAttribute("href");

        // Check if the link matches the Mastodon regex pattern
        if (mastodonRegex.test(href)) {
            const match = href.match(mastodonRegex);
            const username = match[4].split("/")[1];
            const postID = match[4].split("/")[2];
            const domain = match[2];

            // Create the iframe embed code
            const embedUrl = `${href}/embed`;
            const scriptSrc = `https://${domain}/embed.js`;
            const iframe = document.createElement("iframe");
            iframe.src = embedUrl;
            iframe.classList.add("mastodon-embed");
            iframe.style.maxWidth = '550px';
            iframe.style.border = "0";
            iframe.style.width = '100%';
            iframe.style.height = '400px';
            iframe.setAttribute("allowfullscreen", "allowfullscreen");
            const script = document.createElement("script");
            script.src = scriptSrc;
            script.async = true;
            iframe.appendChild(script);

            // Replace the link with the embedded post
            link.parentNode.replaceChild(iframe, link);

            // Listen for the "load" event on the iframe
            iframe.addEventListener("load", () => {
                // Get the width and height of the content inside the iframe
                const iframeContentWidth = iframe.contentWindow.document.body.offsetWidth;
                const iframeContentHeight = iframe.contentWindow.document.body.offsetHeight;

                // Set the width and height of the iframe to the size of the content
                iframe.width = iframeContentWidth;
                iframe.height = iframeContentHeight;
            });

        }
    }
})();

To use this script:
  1. Install the Tampermonkey browser extension if you haven't already.
  2. Open the Tampermonkey dashboard and click on the "Create a new script" button.
  3. Replace the default content with the userscript provided above.
  4. Save the script (Ctrl+S or Command+S) and make sure it's enabled in Tampermonkey.

some posts with a mastodon link.



AjsW1Bq.png
 

Macallik86

Superstar
Supporter
Joined
Dec 4, 2016
Messages
6,495
Reputation
1,372
Daps
21,204
i've been using a userscript to view mastodon links as embeds on the coli. the only issue is it doesn't dynamically resize.
Repped. Imma give it a shot (and take into account the very clear reminder that I need to step up my LLM requests 😂)
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
55,678
Reputation
8,224
Daps
157,178
Repped. Imma give it a shot (and take into account the very clear reminder that I need to step up my LLM requests 😂)

using LLM's has really improved by ability to understand and write regular expression patterns.

sometimes i just let them give me an outline even if it doesn't work and I just tweak it to make it work for me.

regex is how I judge all LLM's I test out.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
55,678
Reputation
8,224
Daps
157,178

nyknick

refuel w/ chocolate milk
Joined
Jul 7, 2012
Messages
18,714
Reputation
6,060
Daps
90,732
So Threads don't have hashtags it seems ?
No hashtags, no search, no DMs, no following feed. Seems like they pushed this out early just to capitalize on Twitter's restrictions. But they could've waited couple of more months and I'm sure Elon would've done something stupid again.

Developers will have their hands full :picard:
 

GnauzBookOfRhymes

Superstar
Joined
May 7, 2012
Messages
12,477
Reputation
2,832
Daps
47,837
Reppin
NULL
No hashtags, no search, no DMs, no following feed. Seems like they pushed this out early just to capitalize on Twitter's restrictions. But they could've waited couple of more months and I'm sure Elon would've done something stupid again.

Developers will have their hands full :picard:

OTOH you have to strike while the iron is hot. I think people are going to give any reasonable alternative a bit of leeway in the beginning, if for no other reason than to spite musk. :russ: He makes it so easy to hate him.

The most important thing that I've seen is the media organizations and other notable ppl quickly setting up shop.
 
Top