当我在Facebook上分享网址时,标题没有显示

问题描述:

我尝试在Facebook上与标题共享网址.我

I try to share url on facebook with title. I do

http://www.facebook.com/sharer/sharer.php?u=http://domain.com/win-a-hot-date/&t=Now this is awesome

,但标题未显示.怎么了?

but title doesn't show up. What's wrong?

不推荐使用't'url参数以及sharer.php

The 't' url parameter has been deprecated as well as sharer.php

下面提供了一个适合您的示例链接(始终对参数值进行编码):

Herewith an example link that should work for you (always encode parameters values):

https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http%3A%2F%2Fdomain.com%2Fwin-a-hot-date%2F&p[title]=Now+this+is+awesome

您可以将这些参数添加到末尾以显示缩略图或摘要:

You could add these parameters to the end to show thumb images or summary:

&p[images][0]=*URL_TO_IMAGE*
&p[summary]=Some+urlencoded+summary

(通常建议将所有与号&替换为HTML的& amp;)

(it is normally advisable to replace all ampersands & with HTML's & equivalent)

但是,如上所述,这是一种已弃用的api方法,使用上述方法可能会产生各种结果,即有时图像不支持它.

Though, as stated above it's a deprecated api method and using the above can produce various outcomes i.e. sometimes images not there is support for it.

有些人报告标题或图像不方便的问题,不得不在文档的head标签中用HTML代码实现OG标签:

Some people reported problems with titles or images not shoeing and had to implement OG tags within their document's head tags in HTML code:

<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description" content="Some descrioton"/>

注意:Facebook建议的一种新方法是使用.

NOTE: a new suggested by Facebook way is to use Feed and Share Dialogs described here. For debuging use this.