【问题标题】:Whatsapp social sharing with MeteorWhatsapp 与 Meteor 进行社交分享
【发布时间】:2017-03-02 14:33:05
【问题描述】:

我的网页上已经有 whatsapp 的社交分享按钮,但是当您选择要发送的联系人时,它只会在书写框上写“title_content url”。似乎 whatsapp 看不到网页的元标记,以创建一个带有图像、标题和描述的漂亮框。

我正在使用以下开放图元标记,它与 facebook 社交共享工作正常:

<meta property="og:type" content="website" />
<meta property="og:title" content="{{event.name}}" />
<meta property="og:description" content="{{eventDescription event.information}}" />
<meta property="og:url" content="{{eventUrl url}}" />
<meta property="og:image" content="{{eventImage event}}" />
<meta property="og:image:width" content="500" />
<meta property="og:image:height" content="500" />
<meta property="fb:app_id" content="#####" />

我的活动没有图标,所以无法设置标签:

<link rel="shortcut icon" href="###.ico" type="image/x-icon">

我尝试使用.png 图像设置它,但它不起作用。那么,我还能做些什么来让 whatsapp 看到我的网站并用图像、标题和描述呈现该框?

【问题讨论】:

  • 你的常规元标签是什么样子的?

标签: meteor web-crawler meta-tags whatsapp socialshare


【解决方案1】:

我刚刚发现发生了什么。当您尝试向 facebook 或 twitter 爬虫提供信息时,您需要一种特殊的方式来做到这一点。所以你必须创建一个带有过滤器和动态内容的爬虫路由(你可以在我创建的本教程中看到:Tutorial)。 使用whatsapp,您无需担心服务器端渲染。当我直接在&lt;head&gt; 上创建我的开放图元标记时。

编辑:

因为我需要动态工作的元标记,我不得不停止在&lt;head&gt; 上直接使用。但是 docHead() 或任何软件包都不适合我。所以我意识到whatsapp 可以在服务器端工作并使用我已经为facebook 使用的相同og: 标签。 我只需要找到它的用户代理 WhatsApp/2.17.107 A 并像我为服务器端路由上的其他用户所做的那样添加许可。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-29
    相关资源
    最近更新 更多