Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add an image to a tweet or how does twitter decide which image urls to render

Tags:

If I post a tweet with a link to a picture it will only display the link. But if twitpic post an image link (or rather a link to a page with an image) twitter will render the image (smaller albeit).

I know twitter now has Tweet Entities but those appear to be for reading and not writing.

And yeah I could use twitpic but I rather not since we already have the images saved and ready to go.

Basically how do you become like: twitpic, lockerz, photobucket, yfrog... so on so that twitter recognizes your links as images.

Update: I know twitter will provide upload image api soon but I would rather have the image content on my site.

like image 992
Adam Gent Avatar asked Aug 03 '11 18:08

Adam Gent


People also ask

How do you attach an image to a Tweet?

Tap the camera icon to add a new photo or video to your Tweet. Tap the photo icon to attach an existing photo, video, or GIF. Once you have 2 or more photos selected, you can tap and hold a photo to drag and reorder before Tweeting.

How do I change the image on a Twitter preview link?

Twitter does not allow users to change the image associated with a Twitter card. To change the featured image in the social post, hover over the Twitter card and click Change to photo post.

Why can't I add a picture to my Tweet?

Images uploaded to Twitter must be smaller than 3MB in size and saved as a GIF, JPEG or PNG file. The BMP, TIFF and animated GIF file formats are not supported by Twitter. Note that you can only upload one image per tweet, whether you are using the main Twitter website or a third-party application.

Can you use any picture for Twitter?

The truth is that under the law, it is the photographer that owns the copyright. Twitter's terms of service allows the platform to use the photo or video but not anyone else.


3 Answers

Update: As noted in comments, refer to this answer for updated information. Twitter now supports a more straightforward way for achieving the same effect.

Twitter Cards overview: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards


Twitter scrapes the URL for images and display them inline for the companies it has partenered with.

The current list includes: DailyBooth, DeviantART, Etsy, Flickr, Justin.TV, Kickstarter, Kiva, Photozou, Plixi, Twitgoo, TwitPic, TwitVid, USTREAM, Vimeo, yfrog, and YouTube. twitter.com/newtwitter

They also support iTunes, blip.tv, Instagram, Rdio, SlideShare, and Dipdive: http://blog.twitter.com/2010/12/now-playing-on-newtwitter-embedded.html

So for you to become like twitpic etc, you need to have a partnership with them. There is no API trick for that. The other way is to use one of those services which is not waht you prefer but seems to be the easiest way out.

like image 175
Mrchief Avatar answered Oct 05 '22 01:10

Mrchief


The top answer to this question is out of date.

Twitter will now show an image for a link shared in a tweet if it contains the following meta info:

<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="{full/absolute image url here}"> 

https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary-card-with-large-image

like image 23
missmatsuko Avatar answered Oct 05 '22 00:10

missmatsuko


Twitter now has an API for what they call Cards. It is using HTML Meta tags just like the Facebook implementation.

https://dev.twitter.com/docs/cards

It is only for white listed approved domain now.

like image 28
rnaud Avatar answered Oct 05 '22 00:10

rnaud