Embedded Tweets
- Transmogrified Tiger
- Puppy Murderer
- Posts: 9334
- Joined: April 25 06, 6:07 pm
- Location: Across the River
Embedded Tweets
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/
-
- GRB Founder
- Posts: 35384
- Joined: December 31 69, 6:00 pm
- Location: Chicago, IL
- Contact:
Re: Embedded Tweets
Thanks! I'll take a look!
- thrill
- bronoun enthusiast
- Posts: 30369
- Joined: April 14 06, 10:45 pm
- Location: barely online
Re: Embedded Tweets
We can do this now.
- New Pagodi
- Perennial All-Star
- Posts: 4225
- Joined: April 18 06, 11:30 pm
- Location: St. Louis
- Contact:
Re: Embedded Tweets
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:
The result is that the script replaces the div with an iframe that shows the content of the post and looks like this:
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:
HTML replacement:
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.
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>
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]
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>