Announcement
Collapse
No announcement yet.
Tweet BBCode
Collapse
This is a sticky topic.
X
X
-
Also updated the BBCode on this site so you can test it here.
- Top
- Translate
- Bottom
-
That's an alternative Tweet BBCode but that's for a Twitter account's timeline and not for individual tweets. In most cases, forum users would want to post a specific tweet into a forum post.
- Top
- Translate
- Bottom
-
Fixed and updated code in the first post.
Here's a sample tweet URL with querystring parameters:
https://twitter.com/vbmodsthatrock/status/1489663748491157511?s=20&t=3i-9zc-TquBRaRNe6r2otg
Last edited by glennrocksvb; 02-26-2022, 05:50 PM.
- Top
- Translate
- Bottom
- Likes 1
-
Removed, I don't want to confuse people with a different code.
- Top
- Translate
- Bottom
Leave a comment:
-
It does. For me it just shows up as blank.Originally posted by glennrocksvb View PostOk, I tried going to Twitter and copy the Tweet URL using the Share icon at the bottom of the tweet post and I see the same querystring. It seems this is Twitter's way to track how many times a tweet is shared? It doesn't break the Tweet BBCode, does it?
- Top
- Translate
- Bottom
Leave a comment:
-
Ok, I tried going to Twitter and copy the Tweet URL using the Share icon at the bottom of the tweet post and I see the same querystring. It seems this is Twitter's way to track how many times a tweet is shared? It doesn't break the Tweet BBCode, does it?
- Top
- Translate
- Bottom
Leave a comment:
-
That is called URL querystring. After you copy the Tweet URL on Twitter, paste it in a text editor. Do you see that querystring?
- Top
- Translate
- Bottom
Leave a comment:
-
I doubt this is a plug in issue. Others dont have this problem. But when i copy a link from twitter...for some reason code is being added to it.
https://twitter.com/NewEraZach_/stat...27064285069315?s=20&t=h5wzfdPYmur0wCko-5LiQw
For instance the bolded part. I always have to delete the question mark and everything after it to get it to post a tweet. I use Chrome. But tested it with firefox and it does the same thing. My guess is its my macbook? Which is up to date.
- Top
- Translate
- Bottom
Leave a comment:
-
I also can't get a button to show up on the editor.
- Top
- Translate
- Bottom
Leave a comment:
-
Stupid newbie question here. Do we copy the entire code to put in the Replacement field? That's what I did, but I haven't been able to get it to work yet.Originally posted by glennrocksvb View PostOne way to integrate social media with forums is to embed tweets from Twitter into forum posts.
Go to AdminCP > Custom BB Codes > Add New BB Code and enter the following information:
Title: Tweet
BB Code Tag Name: tweet
Replacement:
Example: [tweet]TweetUrlOrTweetIdHere[/tweet]Code:<div data-tweet-param="{param}"></div><script>(function(){function k(a,c){var d=Element.prototype;return(d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.msMatchesSelector||function(a){return-1!==[].indexOf.call(document.querySelectorAll(a),this)}).call(a,c)}function g(a,c){return a?k(a,c)?a:"HTML"===a.tagName?null:g(a.parentNode,c):null}var b="{param}",a,e=document.getElementsByTagName("script"),e=e[e.length-1],f;if(/^http[s]*:\/\//.test(b)){a=document.createElement("a");a.href=b;b=a.pathname.substring(a.pathname.lastIndexOf("/")+1)}f=e.parentNode.querySelector('[data-tweet-param="{param}"]:empty');(a=g(f,".js-post"))?a=a.getAttribute("data-node-id"):(a=g(f,".js-post-sm"),a=a?a.getAttribute("data-nodeid"):Math.floor(Math.random()*10000));a="t_"+(a||"")+"_"+b;window[a]=function(a){f.innerHTML=a.html;a=f.getElementsByTagName("script");for(var c,d=document.getElementsByTagName("head")[0],b=0;b<a.length;b++)a[b].src?(c=document.createElement("script"),c.src=a[b].src,d.appendChild(c)):eval(a[b].textContent)};var h=document.createElement("script");h.src="https://api.twitter.com/1/statuses/oembed.json?id="+b+decodeURIComponent("%26")+"callback="+a;e.parentNode.appendChild(h)})();</script>
Other Options: Select Yes to all starting from "Remove Tag If Empty" option (for Button Image option, you could specify image path. If specified, a new button for this BB Code will appear in the editor)
Demo:
This tweet:
[tweet]https://twitter.com/noypiscripter/status/758114543033647104[/tweet]
or just using the Twitter Post ID
[tweet]758114543033647104[/tweet]
will be rendered as:
To get the Tweet URL, go to a tweet on Twitter, click on the 3 dots icon below the tweet, choose "Copy link to Tweet" and then copy the URL.
Other sample:
- Top
- Translate
- Bottom
Leave a comment:
-
The code work on my 3.8.11 and 5.6.1 forums. It's the same code. It work with activated parameter/option. Probably, it work on vB4 too.
- Top
- Translate
- Bottom
Leave a comment:
-
Starting to think it was a twitter issue....I don't know.
- Top
- Translate
- Bottom
Leave a comment:
Latest Posts
Collapse
-
Reply to some ideas for new modsin Chit Chatby desmomax
I finally created a mod that allows you to add an icon to each post with options for sharing on other platforms. I honestly thought it was absurd that...
Today, 03:59 AM -
by flohseHi Glenn, what do you think about adding "Like Counts" similar to "Like Counts on Postbit and Profile" (when this mod is in use) in...Yesterday, 11:28 PM
-
Get Affordable and Fast VPS for vBulletin -
Reply to push notification prompt?by desmomaxhy glenn
have you thought about this?Yesterday, 05:44 AM

Leave a comment: