Embedding a Tweet

Hi, I’m having problems displaying a Tweet. This is my code:

Captura de Pantalla 2021-07-13 a la(s) 1.14.40 p. m.

And instead of getting the Tweet, this is the result:

Captura de Pantalla 2021-07-13 a la(s) 1.15.38 p. m.

1 Like

Hello @davera-017

You can simply embed your tweet link by using shields.io. You can make badges out of shields by providing the link you need to embed and add the badge to the streamlit using the st.write

st.write(''' 
[![Tweet]("twitter/url?url=https%3A%2F%2Fshields.io")(https://twitter.com/OReillyMedja/status/901048172738482176)
''')

which would look like this :
Twitter URL
I have already created a GitHub star badge made from shields.io to use in my streamlit app.

You could refer Shields for more badges

Hope it helps you! :tada:

Regards,
Harisankar

1 Like

Hello @davera-017
Try the following one, there are some changes in the code from the previous one.

st.write('''
[![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2FOReillyMedja%2Fstatus%2F901048172738482176)](https://twitter.com/OReillyMedja/status/901048172738482176)
''')

Output would look like this:

Twitter URL

This would work perfectly!
So take a look into this.

Cheers!!

Harisankar

did that work out