L
L
Lenar Fattakhov2015-03-17 18:58:40
JavaScript
Lenar Fattakhov, 2015-03-17 18:58:40

Is it possible to attach a picture when sharing to Twitter?

I share from the site to Twitter as in the article on Habré habrahabr.ru/post/156185

url  = 'http://twitter.com/share?';
url += 'text='      + encodeURIComponent(ptitle);
url += '&url='      + encodeURIComponent(purl);
url += '&counturl=' + encodeURIComponent(purl);

But for some reason, there is no link to the image here, and besides, Twitter does not take data from the og: title meta tag.
Can you please tell me if there is any way to attach an image to a post?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Naumov, 2015-03-17
@fr_end

I personally do this markup in the head

<meta name="twitter:card" content="">
    <meta name="twitter:site" content="">
    <meta name="twitter:creator" content="">
    <meta name="twitter:title" content="">
    <meta name="twitter:description" content="">
    <meta name="twitter:image:src" content="">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question