• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Twitter media site

Case

Active member
#1
Hi guys

I did try searching but couldn't find this already.

This will allow you to post a link to a tweet and the tweet is embedded like so...



Direct link to tweets look like this: http://twitter.com/twitter/status/248036336345415682


Media Site ID: twitter

Site Title: Twitter
Site URL: https://twitter.com/

Match URLs: https://twitter.com/*/status/{$id}
http://twitter.com/*/status/{$id}

Embed HTML: <blockquote class="twitter-tweet"><p>Tweet</p>&mdash; Twitter API (@user) <a href="https://twitter.com/*/status/{$id}" data-datetime="date">date</a></blockquote><script src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Only had xenForo a few days so sorry if this has been covered already.

Cheers
 

Chris D

XenForo developer
Staff member
#2
This is cool.

I believe it might already be in a massive BB Code Media Site pack in the resource manager but it's not that easy to find.
 

Case

Active member
#3
Thanks, Chris.

Yea, I couldn't find anything after search for a bit. If anyone has a link to the media pack I'd like to take a look.
 

Chris D

XenForo developer
Staff member
#6
It was in that thread by EQNoble somewhere... I remember seeing it, I had commented on it.

http://xenforo.com/community/threads/bbcode-mediasites-package.26710/
Thanks mate spot on.

I couldn't even find this in Google o_O

Thanks, Chris.

Yea, I couldn't find anything after search for a bit. If anyone has a link to the media pack I'd like to take a look.
http://xenforo.com/community/resources/xxms-bbcode-mediasites-package.27/

Yes, it does have Twitter in it... that being said. There's nothing to stop you from releasing it as a stand alone release in the Resource Manager. Seeing as I couldn't even find that package in Google, I'm sure just the Twitter functionality would be useful.
 

Sheldon

Well-known member
#7
Yeah, I will be looking at this closely.

The other version gave me some problems (pics are gone, but they would switch after a refresh).... look forward to seeing this though.
 
#9
I've tried this code - but it adds a big space from the top of the post to the tweet, as if it implements around 10-15 blank lines.

Any ideas?
 

Case

Active member
#10
I've tried this code - but it adds a big space from the top of the post to the tweet, as if it implements around 10-15 blank lines.

Any ideas?
Yea, twitter add their own css which clears left & right of the tweet so it sits under the user profile details.

You can't solve it by adding css to your extra.css file because the twitter css doesn't fire until it hits the embedded tweet on the page.

A hack is to add this to the end of your footer template...

HTML:
<style>
.twitter-tweet-rendered { clear: none!important; }
.twt-inline .author {overflow: hidden!important;}
</style>
Unless anyone has another solution?
 
#11
After I made that post, I decided to have a look myself. Figured out it was the clear left & right.

So I add a line in my extra.css that's seem to have done the trick. :)

Code:
#twitter-widget-0.twitter-tweet-rendered {
clear: none !important;
}
*edit* this only works for the first embed - still trying to figure out for multiples.

Thanks.
 

Case

Active member
#12
After I made that post, I decided to have a look myself. Figured out it was the clear left & right.

So I add a line in my extra.css that's seem to have done the trick. :)

Code:
#twitter-widget-0.twitter-tweet-rendered {
clear: none !important;
}
*edit* this only works for the first embed - still trying to figure out for multiples.

Thanks.
Cool. Let me know if you can figure it out through the the extras.css

I found I needed to chuck that code in the footer.
 

EQnoble

Well-known member
#13
A hack is to add this to the end of your footer template...

HTML:
<style>
.twitter-tweet-rendered { clear: none!important; }
.twt-inline .author {overflow: hidden!important;}
</style>
Unless anyone has another solution?
I fixed it myself but i didn't add the css to the footer I had manipulated it with a completely different approach.., I am testing one more thing but I think I got it...
fddfdfdf.png


but if the other method works... great, one less bbcode for me to fix :)... *

if you want to see what I did pm me and you can try it yourself and let me know if it works for you...what I did I normally wouldn't do, but since twitter already does what I wouldn't have, it wouldn't make a difference if I didn't, as long as tweets render so will my method...if tweets don't render my method wouldn't either which wouldn't matter, because the tweet wouldn't render anyways...if you need some help adding things to the resource manager lemme know I can walk you through it though if you can post in the forums, adding to the resource manager will be a breeze once you try it...worst comes to worst and you mess up, you delete the resource post and try again :)




Speaking of which....who wants to help...anyone ...any takers... :)
fddfdfdf.png
 

EQnoble

Well-known member
#15
What do you need help with? I'm game...

I need to get a couple people to work together to test the bbcodes periodically...now being an important period as I am very tied up at the moment in life and it always seems like once i get rolling i need to go to sleep.

The codes need to be tested every so often as they update things @ the media source site and that effects certain aspects of embedding and retrieving the embed code itself from a site and every site owner does their own different thing whenever they want so you have to keep tabs on it sort of or you end up in a short time with a craptastic amount of broken codes.


I would also like to work with a few people to vet sites for a 'possible bbcodes' list that we can keep track of off site as we test things to later get dropped here. A copy of xf could serve as a place to internally process possible sites that we spot as well as for requests made here @xf where our discussion of the mediasites will itself be away from the public face as well as function as a test bed where we can prove out bbcodes before releasing them.


If you are interested in any of that hit me up in a convo.
 
#16
My embed is saying this now...

Tweet
— Twitter API (@user) date
I have no idea why it is like that, it didnt not look like that a few hours ago. Does that mean there may be a problem with the API, or the embed code may have changed or something?
 

EQnoble

Well-known member
#18
hence why i didnt update everyone with my fix for the vertical spacing issues...because I knew this was going to happen....they changed their output.

i am looking at the fix now...