How does Facebook Sharer select Images and other metadata when sharing my URL?

前端 未结 12 2047
忘掉有多难
忘掉有多难 2020-11-21 04:20

When using Facebook Sharer, Facebook will offer the user the option of using 1 of a few images pulled from the source as a preview for their link. How are these images selec

12条回答
  •  被撕碎了的回忆
    2020-11-21 05:00

    From my experience, the http://www.facebook.com/sharer.php does not use meta tags. It uses the string you pass. See below.

    http://www.facebook.com/sharer.php?s=100&p[title]=THIS IS MY TITLE&p[summary]=THIS IS MY SUMMARY&p[url]=http://www.MYURL.com&&p[images][0]=http://www.MYURL.com/img/IMAGEADDRESS

    The meta tags work with Facebook's developer like/send buttons, as does the other Open Graph info. So if you use one of Facebook's actual elements like the comments and such, that will all tie into the Open Graph stuff.

    UPDATE: There are two ways to use the sharer * note the ?s versus the ?u value in the query string
    1 ==> STRING: http://www.facebook.com/sharer.php?s + content from above
    ~~> Will pull info from the string.
    2 ==> URL: http://www.facebook.com/sharer.php?u=url where url equals an actual url
    ~~> Will scrape the page provided in the url value
    ~~> You can test test the values here: https://developers.facebook.com/tools/debug

提交回复
热议问题