Very good like always 😉
NodeBB Twitter / X embeds
-
I’ve had it where a tweet will show twice but once the page has been refreshed it’ll show the one again.
-
Updated code to address the duplicate tweet issue
https://github.com/phenomlab/nodebb-twitter-embeds/blob/main/embeds.js
-
@phenomlab That is awesome, great job!
-
Have you experienced that some posts will not show up after they have been posted, or that the post will look greyed out? This goes away if you refresh the page.
-
@OT Not seen this personally. Are you using the latest commit?
-
An exemple of tweet don’t embed with last code @phenomlab
https://x.com/SaxX/status/1850458923481825567
EDIT:
Strange, work here but not on my forum:
Other tweets works great
Mistery
-
@DownPW Are you sure you’re using the latest commit?
-
@DownPW said in NodeBB Twitter / X embeds:
EDIT:
Strange, work here but not on my forum:
Just looking at this again, and it seems that SaxX in the URL is written as SaxX - was that intentional?
-
@phenomlab said in NodeBB Twitter / X embeds:
Just looking at this again, and it seems that SaxX in the URL is written as SaxX - was that intentional?
I don’t know. I guess but that doesn’t explain that working here and not on my forum… hmm
URL:
https://x.com/_SaxX_/status/1850458923481825567
Itt seems on my forum the “_” character was delete in the URL (Don’t know why) :
-
@DownPW Can you PM me the link to prod so I can have a look?
-
@DownPW There appears to be a space inserted in the URL?
Note, after the
/
where it is formatted as/ SaxX/
-
hmm not on my screen :
but “_” dissapear
-
@DownPW Can you grant my login temporary admin?
-
@DownPW I see the issue. The URL has underscores present
This basically means that the composer sees this as Markdown and is attempting to render it as such. It’s not a bug in the X embed code. I may be able to work around it though.
-
@phenomlab said in NodeBB Twitter / X embeds:
@DownPW I see the issue. The URL has underscores present
This basically means that the composer sees this as Markdown and is attempting to render it as such. It’s not a bug in the X embed code. I may be able to work around it though.
yep I tell you that here :
@DownPW said in NodeBB Twitter / X embeds:
URL:
Itt seems on my forum the “_” character was delete in the URL (Don’t know why) :
-
@DownPW Yes. Can you grant me admin temporarily for your site?
-
@DownPW this should work now with the below commit
https://github.com/phenomlab/nodebb-twitter-embeds/blob/main/embeds.js
The reason is that markdown processes the URL and replaces
_
with<em>
meaning the tweet can no longer be rendered. The quick “fix” would be to escape the underscore characters, so_SaxX_
becomes\_SaxX\_
but that really is ugly, and places the responsibility on the OP, or an admin to go in and makes those changes afterwards.This new code effectively changes
into
https://x.com/\_SaxX\_/status/1850458923481825567?mx=20
It then removes the
<em></em>
tags, and implodes the URL so the Tweet Parser can read it. In a nutshell, you land up with thishttps://x.com/SaxX/status/1850458923481825567
-
@phenomlab said in NodeBB Twitter / X embeds:
@DownPW this should work now with the below commit
https://github.com/phenomlab/nodebb-twitter-embeds/blob/main/embeds.js
The reason is that markdown processes the URL and replaces
_
with<em>
meaning the tweet can no longer be rendered. The quick “fix” would be to escape the underscore characters, so_SaxX_
becomes\_SaxX\_
but that really is ugly, and places the responsibility on the OP, or an admin to go in and makes those changes afterwards.This new code effectively changes
into
https://x.com/\_SaxX\_/status/1850458923481825567?mx=20
It then removes the
<em></em>
tags, and implodes the URL so the Tweet Parser can read it. In a nutshell, you land up with thishttps://x.com/SaxX/status/1850458923481825567
That’s Fix works great
-
@phenomlab Still have this issue where certain posts will show up blank until you refresh the page. Any clue what to do? Using your latest code.
-
@OT I honestly am not able to replicate this. Can you PM me a link to a post on your forum with the specific issue so I can have a look?
Related Topics
-
-
-
-
-
-
-
[NODEBB] Stats
Unsolved Customisation -