Render Blockquote HTML from GET?

rest
oembed

#1

I am using GET/statuses/user_timeline and storing each tweet. The returned blockquote html for each tweet is injected into the page, but it is not rendering. I just see the HTML

<blockquote class="twitter-tweet"><p lang="en" dir="ltr"><a href="https://twitter.com/Amy_Siskind">@Amy_Siskind</a> please keep writing these</p>&mdash; Julien Smith (@julien) <a href="https://twitter.com/julien/status/822880486943035392">January 21, 2017</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

What is the best pattern to take the result of our call and have it render on the page? Perhaps I need to take each tweet and pass it to the oembed url as a parameter?

Thanks for any insight!


#2

How are generating the html? Seems like it’s being sanitized somewhere along the way.


#3

Are you retrieving the Tweets from the publish.twitter.com /oembed endpoint? I’m not aware that /statuses/user_timeline returns embeddable HTML.


#4

Yes we were hitting that oembed endpoint once we have the tweetId. We ended up getting it working by using twttr.widgets.createTweet with the tweet Id via script on the HTML page. Much cleaner.

Thank you!