Skip to content

NodeBB Twitter / X embeds

Let's Build It
34 6 16.5k 1
  • wrote on last edited by
    #10

    This is how it shows up for us. Just have the random dupes of the same tweet. Of course, users are complaining of seeing a tweet repeat three times, but they quickly forgot that a tweet was just showing the X.com using Iframely or any other plugin.

    2d52ca26-02ea-47a4-8b8a-dcff0be06579-image.png

  • OT OT

    This is how it shows up for us. Just have the random dupes of the same tweet. Of course, users are complaining of seeing a tweet repeat three times, but they quickly forgot that a tweet was just showing the X.com using Iframely or any other plugin.

    2d52ca26-02ea-47a4-8b8a-dcff0be06579-image.png

    wrote on last edited by
    #11

    @OT can you post the actual tweet url ?

  • wrote on last edited by JAC
    #12

    I’ve had it where a tweet will show twice but once the page has been refreshed it’ll show the one again.

  • wrote on last edited by
    #13

    Updated code to address the duplicate tweet issue

    https://github.com/phenomlab/nodebb-twitter-embeds/blob/main/embeds.js

  • Updated code to address the duplicate tweet issue

    https://github.com/phenomlab/nodebb-twitter-embeds/blob/main/embeds.js

    wrote on last edited by
    #14

    @phenomlab That is awesome, great job!

  • wrote on last edited by
    #15

    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 OT

    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.

    wrote on last edited by
    #16

    @OT Not seen this personally. Are you using the latest commit?

  • wrote on last edited by DownPW
    #17

    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:

    4ef65a31-cac0-4dd3-8c1d-e588275f1455-image.png

    Other tweets works great

    6ea31c0e-7d42-4a97-8780-605c1af54faa-image.png

    Mistery 🤥

  • 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:

    4ef65a31-cac0-4dd3-8c1d-e588275f1455-image.png

    Other tweets works great

    6ea31c0e-7d42-4a97-8780-605c1af54faa-image.png

    Mistery 🤥

    wrote on last edited by
    #18

    @DownPW Are you sure you’re 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:

    4ef65a31-cac0-4dd3-8c1d-e588275f1455-image.png

    Other tweets works great

    6ea31c0e-7d42-4a97-8780-605c1af54faa-image.png

    Mistery 🤥

    wrote on last edited by
    #19

    @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?

  • @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?

    wrote on last edited by DownPW
    #20

    @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) :

    b30dee39-bba9-461b-bdf5-972cc54a5940-image.png

    635ea3d6-8682-4103-baa6-8bc74985b331-image.png

  • @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) :

    b30dee39-bba9-461b-bdf5-972cc54a5940-image.png

    635ea3d6-8682-4103-baa6-8bc74985b331-image.png

    wrote on last edited by
    #21

    @DownPW Can you PM me the link to prod so I can have a look?

  • @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) :

    b30dee39-bba9-461b-bdf5-972cc54a5940-image.png

    635ea3d6-8682-4103-baa6-8bc74985b331-image.png

    wrote on last edited by
    #22

    @DownPW There appears to be a space inserted in the URL?

    3c890390-dbbe-46af-a6c9-64132fc16c20-image.png

    Note, after the / where it is formatted as / SaxX/

  • wrote on last edited by DownPW
    #23

    hmm not on my screen :

    image.png

    but “_” dissapear

  • hmm not on my screen :

    image.png

    but “_” dissapear

    wrote on last edited by
    #24

    @DownPW Can you grant my login temporary admin?

  • wrote on last edited by
    #25

    @DownPW I see the issue. The URL has underscores present

    image.png

    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.

  • @DownPW I see the issue. The URL has underscores present

    image.png

    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.

    wrote on last edited by
    #26

    @phenomlab said in NodeBB Twitter / X embeds:

    @DownPW I see the issue. The URL has underscores present

    image.png

    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) :

  • @phenomlab said in NodeBB Twitter / X embeds:

    @DownPW I see the issue. The URL has underscores present

    image.png

    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) :

    wrote on last edited by
    #27

    @DownPW Yes. Can you grant me admin temporarily for your site?

  • wrote on last edited by phenomlab
    #28

    @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

    47f6ce91-7561-4b94-8db7-ea353b57fadd-image.png

    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 this

    https://x.com/_SaxX_/status/1850458923481825567

  • @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

    47f6ce91-7561-4b94-8db7-ea353b57fadd-image.png

    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 this

    https://x.com/_SaxX_/status/1850458923481825567

    wrote on last edited by
    #29

    @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

    47f6ce91-7561-4b94-8db7-ea353b57fadd-image.png

    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 this

    https://x.com/_SaxX_/status/1850458923481825567

    That’s Fix works great 🙂


Related Topics