0

我正在尝试使用 facebook graph api 发布一篇即时文章。我已经完成了以下步骤: 1- 获取具有必要权限的页面访问令牌 2- 声明我网站的 URL。该网站的网址已被 Facebook 接受 3-在我发布的图形 API 中,页面访问令牌未过期

{page-id}/instant_articles?development_mode=true&html_source=<html lang="en" prefix="op: http://media.facebook.com/op#"><head><meta charset="utf-8"><link rel="canonical" href="http://{websites´s URL}/instantarticle.html"><link rel="stylesheet" title="default" href="#"><title>Instant Articles</title><meta property="fb:article_style" content="Test Article Style"></head><body><article><header><h1> Instant Articles </h1><h2>Get familiar with your new storytelling tools. Make your media come alive, and keep readers coming back for more</h2><h3 class="op-kicker">Introduction</h3><address>Instant Articles Team</address><time class="op-published" dateTime="2016-2-04T08:00">February 4th 2016, 8:00 AM</time><time class="op-modified" dateTime="2016-2-04T08:00">February 4th 2016, 8:00 AM</time></header><p>Yes, it’s true. Instant Articles open on mobile devices really quickly.</p></body></html>

4- 我得到一个响应 ID。当我访问此 ID 时,图形 api 显示

"message": "缺少文章的规范 URL:没有为这篇文章指定 URL。需要声明规范 URL 并将其放置在 HTML 中以生成即阅文。有关更多信息,请参阅即阅文文档中发布文章下的 URL有关声明和插入规范 URL 的信息。”

我不明白有什么问题?任何想法?

谢谢!!!

4

1 回答 1

0

我发送的 html 源代码不正确。我已经通过 facebook 开发人员设置检查了我的来源,并与他一起撰写了一篇即时文章。但是我用graph api发布了相同的源代码,我得到了同样的错误。

新的来源是这个

{page-id}/instant_articles?development_mode=true&html_source=<!doctype html><html lang="en" prefix="op: http://media.facebook.com/op#"><head><meta charset="utf-8"><link rel="canonical" href="http://{canonical_url}/instantarticle.html"><meta property="op:markup_version" content="v1.0"></head><body><article><header><h1>Segundo articulo instantaneo</h1><h2>Article Subtitle</h2><time class="op-published" datetime="2014-11-11T04:44:16Z">November 11th, 4:44 PM</time><time class="op-modified" dateTime="2014-12-11T04:44:16Z">December 11th, 4:44 PM</time><address <a rel="facebook" href="https://www.facebook.com/Epfake/">EP Fake</a>EuropaPress Fake</address><address><a>TR Vishwanath</a>Vish is a scholar and a gentleman.</address><h3 class="op-kicker">This is a kicker</h3></header><p> Article content </p><footer><aside>Acknowledgements</aside><small>Legal notes</small></footer></article></body></html>

谢谢!!我希望你的帮助

于 2016-05-19T16:27:53.127 回答