ShareThis的自定义摘要,网址和标题

ZKK*_*ZKK 8 facebook sharethis google-plus

我已经将sharethis整合到我的网站中.我想自定义标题,并且会通过Facebook和谷歌加号,但由于某种原因,Facebook和GOOGLEPLUS只挑选了该URL,并且不显示我在st_title和st_summary变量提供的标题和摘要进行共享摘要.

将此添加到头部.

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "1234"});</script>
Run Code Online (Sandbox Code Playgroud)

在我的HTML中我有这样的东西

<span class='st_facebook' st_url="http://www.cnn.com" st_title="CNN-Test Website" st_summary="Shared CNN news"></span>
<span class='st_googleplus' st_url="http://www.cnn.com" st_title="CNN-Test Website" st_summary="Shared CNN news"></span>
Run Code Online (Sandbox Code Playgroud)

另外,我不能使用opengraph(元og标签).我也尝试过javascript来设置标题和摘要,但结果仍然相同.

Riz*_*Riz 11

好吧,当涉及到这个时,我也碰到了,你没有获得facebook股票的自由分享和自定义网址因为facebook在获取这些值时没有考虑span元素的属性.Facebook使用Open Graph Concept并从网站的元标记中抓取信息,网址的网址在og:url元标记中提供.要允许Facebook显示您的标题和自定义网址,请执行以下操作:

1.确保在stLight.options javascript中添加"shorten:false"行,否则您将无法获得完整的网站网址2.将这些标记添加到您的头部:(您可以将这些标记与现有的元标记一起添加) )

<meta property="og:title" content="Yor desired title"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="Your website url"/>
<meta property="og:image" content="your custom image path"/>
<meta property="og:description" content="A short description of your website"/>
Run Code Online (Sandbox Code Playgroud)

图像应该更好200X200像素.如果你想了解更多... http://developers.facebook.com/docs/technical-guides/opengraph/built-in-objects/

希望能帮助到你 !