State of the Brontos

User avatar
Mazian
Posts: 520
Joined: Sat Jan 25, 2014 3:47 pm
Location: Lullaby Supermarket

Re: State of the Brontos

Postby Mazian » Sun Apr 23, 2023 11:43 pm

That definitely wouldn't work as-is - the bit I posted was a response from the Twitter server, not board-side code.

I believe the test would be

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(data.error || data.errors) {
    document.write('[Error displaying tweet]");
  }
  else {
    document.write(data.html);
  }
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx&dnt=true"></script>
<div class='twitter' onLoad='loadx().html'/></div>

User avatar
Mothra
Woah Dangsaurus
Posts: 3966
Joined: Mon Jan 20, 2014 7:12 pm
Location: Boston, MA
Contact:

Re: State of the Brontos

Postby Mothra » Sun Apr 23, 2023 11:46 pm

Mazian wrote:That definitely wouldn't work as-is - the bit I posted was a response from the Twitter server, not board-side code.

I believe the test would be

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(data.error || data.errors) {
    document.write('[Error displaying tweet]");
  }
  else {
    document.write(data.html);
  }
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx&dnt=true"></script>
<div class='twitter' onLoad='loadx().html'/></div>

Hm, copy/pasted it in, but using this as a test case, doesn't look like it worked.

User avatar
Upthorn
Posts: 1032
Joined: Wed Jan 22, 2014 5:41 pm
Location: mastodon.social/@upthorn
Contact:

Re: State of the Brontos

Postby Upthorn » Sun Apr 23, 2023 11:49 pm

Mothra wrote:Guys, I need you to write out the whole thing, I have no idea what any of this is.

I've put this together in what I'm guessing is the right order, and I've pasted it in.

If this is wrong, please correct it and paste the whole thing so I can copy/paste it.

Okay. So there was a minor issue in your thing. And I don't totally trust what The Riddler wrote, anyway, so I went ahead and checked StackExchange for a couple answers and got:

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(typeof data.html !== 'undefined') {
    if (isset(data.html)) {
      document.write('[Error displaying tweet]");
      return;
    }
  document.write(data.html);
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>
How fleeting are all human passions compared with the massive continuity of ducks.

User avatar
Mothra
Woah Dangsaurus
Posts: 3966
Joined: Mon Jan 20, 2014 7:12 pm
Location: Boston, MA
Contact:

Re: State of the Brontos

Postby Mothra » Sun Apr 23, 2023 11:53 pm

Upthorn wrote:Okay. So there was a minor issue in your thing. And I don't totally trust what The Riddler wrote, anyway, so I went ahead and checked StackExchange for a couple answers and got:

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(typeof data.html === 'undefined' || !isset(data.html)) {
    document.write('[Error displaying tweet]");
  }
  else {
    document.write(data.html);
  }
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

No dice here, either.

Copied it in, enabled it, checked the Mongrelpost, it was blank. Replaced it with the original embed code, the tweet appears.

User avatar
Upthorn
Posts: 1032
Joined: Wed Jan 22, 2014 5:41 pm
Location: mastodon.social/@upthorn
Contact:

Re: State of the Brontos

Postby Upthorn » Sun Apr 23, 2023 11:56 pm

Mothra wrote:No dice here, either.

Copied it in, enabled it, checked the Mongrelpost, it was blank. Replaced it with the original embed code, the tweet appears.

Was re-thinking my thing and editing my code while you tested. Try

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(typeof data.html !== 'undefined') {
    if (isset(data.html)) {
      document.write(data.html);
      return;
    }
  document.write('[Error displaying tweet]');
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

After that I'm out of ideas.

EDIT: AH FUCK I FUCKED IT UP AGAIN. TRY COPY-PASTING ONE LAST TIME IF YOU DIDN'T SEE THIS EDIT BEFORE YOU TRIED!
How fleeting are all human passions compared with the massive continuity of ducks.

User avatar
Mothra
Woah Dangsaurus
Posts: 3966
Joined: Mon Jan 20, 2014 7:12 pm
Location: Boston, MA
Contact:

Re: State of the Brontos

Postby Mothra » Mon Apr 24, 2023 12:05 am

Upthorn wrote:Was re-thinking my thing and editing my code while you tested. Try

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(typeof data.html !== 'undefined') {
    if (isset(data.html)) {
      document.write(data.html);
      return;
    }
  document.write('[Error displaying tweet]');
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

After that I'm out of ideas.

EDIT: AH FUCK I FUCKED IT UP AGAIN. TRY COPY-PASTING ONE LAST TIME IF YOU DIDN'T SEE THIS EDIT BEFORE YOU TRIED!

Tried the post-edit code, but nadda, same issues where it doesn't embed at all.

Reverted back to the O.G. - willing to try others if people want to take more swings at this.

User avatar
Upthorn
Posts: 1032
Joined: Wed Jan 22, 2014 5:41 pm
Location: mastodon.social/@upthorn
Contact:

Re: State of the Brontos

Postby Upthorn » Mon Apr 24, 2023 1:37 am

so I'm now developing a tampermonkey userscript to replace brontoforum.us [twitter] tag code with my custom version so I can test as I attempt to develop a new version that displays tweet loading failures...
How fleeting are all human passions compared with the massive continuity of ducks.

User avatar
Upthorn
Posts: 1032
Joined: Wed Jan 22, 2014 5:41 pm
Location: mastodon.social/@upthorn
Contact:

Re: State of the Brontos

Postby Upthorn » Mon Apr 24, 2023 5:59 am

Mothra wrote:
Upthorn wrote:Was re-thinking my thing and editing my code while you tested. Try

Code: Select all

<script type="text/javascript">
function loadx(data) {
  if(typeof data.html !== 'undefined') {
    if (isset(data.html)) {
      document.write(data.html);
      return;
    }
  document.write('[Error displaying tweet]');
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

After that I'm out of ideas.

EDIT: AH FUCK I FUCKED IT UP AGAIN. TRY COPY-PASTING ONE LAST TIME IF YOU DIDN'T SEE THIS EDIT BEFORE YOU TRIED!

Tried the post-edit code, but nadda, same issues where it doesn't embed at all.

Reverted back to the O.G. - willing to try others if people want to take more swings at this.


The actual solution is so simple as to make me furious it took me this long to find:

Code: Select all

<script type="text/javascript">
function loadx(data) {
  document.write(data.html);
}
</script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={IDENTIFIER}&callback=loadx&dnt=true" onerror="document.write('[ERROR LOADING TWEET!]')"></script>


Edit: So I figured out early on that the reason Thad's solution didn't work is that loadx(data) is only called when the api actually loads a tweet. When there is no tweet, the API is supposed to call the callback with the json blob mazian posted, but it actually just gives an error 400.
So I spent hours trying to figure out how to get tampermonkey userscripts to load external resources without triggering a cross-origin-resource-security violation. Then, when I worked out what function to call and how to get tampermonkey to let me access it, and made my first successful tests of getting the API response, and was finally ready to start trying js to parse it when successful and error out when it failed...
The tampermonkey API simply... stopped making those network requests at all. Even when I reverted to the version of the script that had *just* successfully done it.

Anyway, all of that turned out to be unnecessary work only because I was bad at googling "html detect external script load failure".
How fleeting are all human passions compared with the massive continuity of ducks.

User avatar
Mongrel
Posts: 21356
Joined: Mon Jan 20, 2014 6:28 pm
Location: There's winners and there's losers // And I'm south of that line

Re: State of the Brontos

Postby Mongrel » Mon Apr 24, 2023 1:02 pm

You guys are all champs. :]
Image

User avatar
Mothra
Woah Dangsaurus
Posts: 3966
Joined: Mon Jan 20, 2014 7:12 pm
Location: Boston, MA
Contact:

Re: State of the Brontos

Postby Mothra » Mon Apr 24, 2023 1:18 pm

That worked! Updated code is now live.

I checked a Thadpost on page two of that Twitter discussion thread and it showed the error correctly.

User avatar
Thad
Posts: 13250
Joined: Tue Jan 21, 2014 10:05 am
Location: 1611 Uranus Avenue
Contact:

Re: State of the Brontos

Postby Thad » Mon Apr 24, 2023 2:51 pm

Seeing it in Firefox with privacy protections turned on, too.

Which is great, because now I know when people are talking about a tweet I can't see.

User avatar
Mazian
Posts: 520
Joined: Sat Jan 25, 2014 3:47 pm
Location: Lullaby Supermarket

Re: State of the Brontos

Postby Mazian » Mon Apr 24, 2023 4:42 pm

Upthorn wrote:The actual solution is so simple as to make me furious it took me this long to find:

There is no better one-line summary of the coding experience.

Thanks for figuring it out!

User avatar
Thad
Posts: 13250
Joined: Tue Jan 21, 2014 10:05 am
Location: 1611 Uranus Avenue
Contact:

Re: State of the Brontos

Postby Thad » Tue Apr 25, 2023 7:55 pm

The following words in your search query were ignored because they are too common words: suikoden.


phpBB are you fucking with me

User avatar
Esperath
Posts: 1318
Joined: Mon Jan 20, 2014 6:42 pm

Re: State of the Brontos

Postby Esperath » Tue May 09, 2023 2:16 am

SA is trying to back up all of their Imgur files before the Imgurpocalypse. I dunno if we can do something similar for bronto and fossilized.bronto , but we're going to have a whole fuckton of dead image links soon.

I went and saved some of my images across the board incarnations, other people may wish to do the same.
pisa katto

ImageImageImage

pisa katto

Lady
Posts: 198
Joined: Tue Jan 28, 2014 11:59 pm

Re: State of the Brontos

Postby Lady » Thu Jul 20, 2023 4:02 pm

Oh, uh, whoops. Suppose there's still value in hunting down and rehosting imgur links? I'm kinda surprised I didn't hear about this at all, but May was kinda a lost month for me

User avatar
Mongrel
Posts: 21356
Joined: Mon Jan 20, 2014 6:28 pm
Location: There's winners and there's losers // And I'm south of that line

Re: State of the Brontos

Postby Mongrel » Mon Sep 25, 2023 4:32 pm

Sorry to annoy, but do we know why the [webm] tags are resizing videos up to force them to the board size? Makes everything huge :(
Image

User avatar
sei
Posts: 1085
Joined: Mon Jan 20, 2014 6:29 pm

Re: State of the Brontos

Postby sei » Mon Sep 25, 2023 6:59 pm

Seeing this all over the forum:
[Error: Tweet has been removed or cannot load.]

Any idea what might be breaking twitter embeds on the client side? Tried killing Adblock, NoScript, and CanvasBlocker, as well as both Chrome and Firefox. Possible that browser privacy settings kill them?
Image

User avatar
Mothra
Woah Dangsaurus
Posts: 3966
Joined: Mon Jan 20, 2014 7:12 pm
Location: Boston, MA
Contact:

Re: State of the Brontos

Postby Mothra » Mon Sep 25, 2023 8:58 pm

sei wrote:Seeing this all over the forum:
[Error: Tweet has been removed or cannot load.]

Any idea what might be breaking twitter embeds on the client side? Tried killing Adblock, NoScript, and CanvasBlocker, as well as both Chrome and Firefox. Possible that browser privacy settings kill them?

Nah it's likely that the URL for Twitter.com is now "X.com", that'd be my guess.

User avatar
Thad
Posts: 13250
Joined: Tue Jan 21, 2014 10:05 am
Location: 1611 Uranus Avenue
Contact:

Re: State of the Brontos

Postby Thad » Tue Sep 26, 2023 1:22 am

I've never been able to see them in Firefox, so I think privacy settings probably do cause issues with them.

But if you could see them before and can't see them now, then yeah that's probably not it in your case.

User avatar
Mongrel
Posts: 21356
Joined: Mon Jan 20, 2014 6:28 pm
Location: There's winners and there's losers // And I'm south of that line

Re: State of the Brontos

Postby Mongrel » Tue Sep 26, 2023 4:41 am

FWIW the URLs still haven't changed.
Image

Who is online

Users browsing this forum: No registered users and 6 guests