Я пытаюсь опубликовать тестовую статью с помощью Facebook Instant Articles PHP SDK:
$the_html = '<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8">
<meta property="op:markup_version" content="v1.0">
<link rel="canonical" href="http://myarticle">
<meta property="fb:article_style" content="default">
</head>
<body>
<article>
<header>
<h1> test title</h1>
<h2> test subtitle </h2>
<time class="op-published" dateTime="2016-06-20T08:00">June 17th 2016, 8:00 AM</time>
<time class="op-modified" dateTime="2016-06-20T08:00">June 17th 2016, 8:00 AM</time>
<p> Test test test </p>
</header>
</article>
</body>
</html>';
$fb = Client::create(
'APP_ID'
'APP_SECRET',
'ACCESS_TOKEN',
'PAGE_ID',
true //development env
);
$instant_article = InstantArticle::create();
$transformer = new Transformer();
libxml_use_internal_errors(true);
$document = new \DOMDocument();
$document->loadHTML($the_html);
libxml_use_internal_errors(false);
$transformer->transform($instant_article, $document);
$fb->importArticle($instant_article, true);
Я получаю это сообщение:
ОТЛАДКА - =========================== ОТЛАДКА - =================== ======== DEBUG — класс контекста: Facebook\InstantArticles\Elements\InstantArticle DEBUG — имя узла: html DEBUG — СОДЕРЖИМОЕ НЕ СООТВЕТСТВУЕТ:
Мне удалось опубликовать статью с помощью Instant Articles API в Graph API Explorer, но я не могу заставить его работать с PHP.
Любая помощь будет принята с благодарностью.