Embedded Tweets

Need support or have a suggestion on how to improve the site? Post it here.
Post Reply
User avatar
Transmogrified Tiger
Puppy Murderer
Posts: 9334
Joined: April 25 06, 6:07 pm
Location: Across the River

Embedded Tweets

Post by Transmogrified Tiger »

With as much as twitter stuff gets shared, having them embedded is really helpful. We added this at NSBB and it's worked great, it adds a [tweet] tag and you put the URL of the tweet between it to embed: http://punyweakling.com/add-a-tweet-bbc ... pbb-forum/

Michael
GRB Founder
Posts: 35384
Joined: December 31 69, 6:00 pm
Location: Chicago, IL
Contact:

Re: Embedded Tweets

Post by Michael »

Thanks! I'll take a look!

User avatar
thrill
bronoun enthusiast
Posts: 30369
Joined: April 14 06, 10:45 pm
Location: barely online

Re: Embedded Tweets

Post by thrill »

We can do this now.

User avatar
New Pagodi
Perennial All-Star
Posts: 4225
Joined: April 18 06, 11:30 pm
Location: St. Louis
Contact:

Re: Embedded Tweets

Post by New Pagodi »

Can a similar addition be added for tumblr? It's a little different, because the post id isn't enough to construct a full code. However, tumblr does give an embed code that looks something like this:

Code: Select all

 <div class="tumblr-post" data-href="https://embed.tumblr.com/embed/post/RiJu6iHoqaBbY2DtrSDo_A/144283208335" data-did="d4e6f4e2fa2cbebe4b2be0495ec913c0a9111d47"><a href="http://newpagodi.tumblr.com/post/144283208335/stlcardinals-rally-cat-did-the-cat-remember">http://newpagodi.tumblr.com/post/144283208335/stlcardinals-rally-cat-did-the-cat-remember</a></div>  <script async src="https://secure.assets.tumblr.com/post.js"></script>
The result is that the script replaces the div with an iframe that shows the content of the post and looks like this:

Image

I've done some experimenting and it seems that neither the link nor the data-did attribute are essential. The only thing that's really needed is the data-href attribute.

So could something like this be done:
BBcode usage:

Code: Select all

[tumblr]{SIMPLETEXT1}://embed.tumblr.com/embed/post/{SIMPLETEXT2}/{IDENTIFIER}[/tumblr]
HTML replacement:

Code: Select all

<div class="tumblr-post" data-href="{SIMPLETEXT1}://embed.tumblr.com/embed/post/{SIMPLETEXT2}/{IDENTIFIER}"></div>  <script async src="https://secure.assets.tumblr.com/post.js"></script>
The catch is that I don't know how a user is supposed to get SIMPLETEXT2 without asking for the embed code first and then cutting out the portion they need.

Post Reply