Preview of url referenced in a tweet ?
February 10, 2020 1:39 PM   Subscribe

If a tweet contains a url you may end up seeing a "full" preview of the web page or you may get a panel which contains just some header text and a logo, a "cut down" preview. Examples of both are inside. How can I tell before I send a tweet which of the two the URL I'm going to reference will be shown as ?

Here's an example of what I call a "full" preview: Link

Here's an example of the "cut down" preview: Link

I'm guessing this is determined by HTTP headers present in the target page - what are those headers and where can I learn more about them (and related headers). I appreciate my guess may be wrong !

In case it matters I'm referring to users seeing Twitter via the web interface, I appreciate the apps may behave differently.
posted by southof40 to Computers & Internet (4 answers total) 3 users marked this as a favorite
 
According to this Twitter help page, it seems that those previews are called "cards". And, if I'm reading it correctly, it seems that the decision about whether to make a big or small image in the preview may be dictated by the "twitter:card" meta property, whose contents can be either "summary", "summary_large_image", "app", or "player". Inspecting the HTML source for your examples, I found that the first page uses "summary_large_image" while the second uses "summary".
posted by mhum at 1:56 PM on February 10 [2 favorites]


I believe the targeted website can control it with "Twitter cards" HTML tags (not HTTP headers, to be exact), see:

About Twitter Cards — Twitter Developers or getting started with cards.

In this case, it looks like

<meta property="twitter:card" content="summary_large_image" />

for the first tweet and

<meta name="twitter:card" content="summary" />

for the second one (summary_large_image vs just summary)/
posted by skynxnex at 1:57 PM on February 10 [1 favorite]


It looks like the large image is due to the <meta name="twitter:card" content="summary_large_image"> tag. See Twitter's docs on cards for more info.
posted by Aleyn at 1:57 PM on February 10 [2 favorites]


You want the Twitter Card Validator.
posted by no regrets, coyote at 2:53 PM on February 10 [3 favorites]


« Older Statistically prove the world isn't fair   |   How can I sign up to register voters in a swing... Newer »

You are not logged in, either login or create an account to post comments