cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

How do I embed *one* tweet?

Jump to solution

Hi, everyone. Apologies for dragging Donald Trump into Canvas, but here's what I'm dealing with....

If I go to a news website, embedded tweets usually look like this (which I like):

251715_Screen Shot 2017-09-12 at 2.00.48 PM.jpg

But when I try to embed just that one tweet into a Canvas page I get this (which I do not like):

251716_Screen Shot 2017-09-12 at 2.02.30 PM.jpg

How do I get the embed to look like the news site rather than what I have above?

The method I'm using to embed the tweet is: alt+F9 > Insert > Media > embed, and then I insert the embed code provided by Twitter. I get the same results when pasting the embed code into Canvas's HTML editor. The embed code is this: 

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Wow, CNN had to retract big story on &quot;Russia,&quot; with 3 employees forced to resign. What about all the other phony stories they do? FAKE NEWS!</p>&mdash; Donald J. Trump (@realDonaldTrump) <a href="https://twitter.com/realDonaldTrump/status/879648931172556802">June 27, 2017</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

For what it's worth, here is the url directly to Donald's tweet: https://twitter.com/realDonaldTrump/status/879648931172556802 

Thanks for any help, Canvas Friends.

1 Solution

Accepted Solutions
Community Member

Presto:

Embedded Tweet: CanvasLIVE Playground 

Plays media, you can like, retweet etc. Dynamic, not static, like screenshot below.

screenshot of embedded tweet

View solution in original post

20 Replies
Community Team
Community Team

Hey Brad,

Just out of curiousity, is there an advantage to embedding just one tweet over just adding a screenshot like you did here?

Thanks,

SD

Instructure
Instructure

There may be a super techy way to do this (awilliams‌ found some cool material in this document that looks promising: Embedding an Uploaded HTML page in an iFrame )

But because I am impatient and really need to work on my coding skills, here's a work around.  (I'll have the time to code one day!)

1) Take a Screencap of the Tweet and Save to your documents

2) Upload the image to your files in Canvas

3) Go to the RCE in your assignment, discussion, wherever you need it and Insert Image

4) Then, Highlight the image and click the "link" button, and paste the URL from the specific tweet

5) Save the page and it should be an image that you can just click which will bring you to the actual tweet.

Its not as clean or streamline as embedding a tweet, but this is just one way to get around a coding headache. Smiley Happy 

Here's a screencast if you need a visual. 

Learner II

Hi bradhorn,

I think it has to do with there being a  <script> tag in the Twitter embed code.

If I remember correctly, The Canvas editor strips out any Javascript it detects in the page. That may be part of what's causing it to format poorly.

I second scottd@instructure.com‌ and say it may be better to simply include an image of the Tweet. (And possibly add a link to the Tweet on the image?)

Community Member

The advantages of an embedded tweet is that it has the functionality of Twitter: if someone is logged in to their Twitter account, they can retweet, etc. from the embedded display.

Canvas does, alas, strip out the javascript, so it is probably more trouble than it is worth to embed, but it can be done.

I've written up a "embed Twitter widget in under 5 minutes" here... widgets are more powerful because they stay alive and keep on updating; if you don't mind spending a few minutes, you can embed the single tweet the same way I imagine.

https://community.canvaslms.com/people/laurakgibbs/blog/2017/07/25/an-instcon-twitter-widget-in-unde... 

Just a (I think) funny aside; the very first question that I came looking to answer the first time I came into the community was how to embed a twitter stream in a page in Canvas (back in 20111).

laurakgibbs you read my subliminal S.O.S. hah! I was thinking "I know Laura has done something like this at some point..." while writing the work around, but forgot to tag you! Love your work, as usual! laurakgibbs Thank You

And now I've got Major Lazer in my head and can't get rid of it, ha ha. It was the first video I came to in my class Twitter stream. 🙂

Of course I had to go look....  I like this one.

I could live pretty happily in a Major Lazer world. 🙂