Answer the question
In order to leave comments, you need to log in
How to send turbo pages to webmaster yandex?
Maybe I misunderstood something.
On the tab with turbo pages it says
Loading via API
For large sites. Batch download. Up to 10,000 items in each task, up to 10 tasks at the same time.
function getItemsXML(request) {
return xml = `<?xml version="1.0" encoding="UTF-8"?><rss xmlns:yandex="http://news.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/" xmlns:turbo="http://turbo.yandex.ru" version="2.0"><channel>`,
Promise.all(request.map(async (document) => {
xml += `<item turbo="true"><link>${document.url}</link><turbo:content><![CDATA[<header><h1>Фото ${document.tags.slice(0, 3).join(', ')}</h1></header><pubDate>${document.indexAt.toUTCString()}</pubDate><figure><img src="${document.image}"><figcaption>Бесплатное фото ${document.tags.slice(-3).join(', ')}</figcaption></figure>]]></turbo:content></item>`
})), xml + `</channel></rss>`
}
function pushYandexTurboItems(request) {
return options.uri = request.address, options.headers['Content-type'] = 'application/rss+xml', options.FormData = request.rss,
http.post(options).then()
}
body:
{ error_message: 'Expected valid xml, found: "..."',
error_code: 'ENTITY_VALIDATION_ERROR' }
ENTITY_VALIDATION_ERROR — тело запроса не прошло валидацию.
return Promise.all(request.map(async (document) => {
return `<item turbo="true"><link>${document.url}</link><turbo:content><![CDATA[<header><h1>Фото ${document.tags.slice(0, 3).join(', ')}</h1></header><pubDate>${document.indexAt.toUTCString()}</pubDate><figure><img src="${document.image}"><figcaption>Бесплатное фото ${document.tags.slice(-3).join(', ')}</figcaption></figure>]]></turbo:content></item>`
}))
Answer the question
In order to leave comments, you need to log in
I also ran into the same problem, it was in the encoding. Rss must be in utf-8.
Class for sending turbopages from YandexAPI
It is worth adding that Yandex turbo pages are very capricious, if the limits of text, blocking, number of pictures, etc. are exceeded, there may be problems with loading the feed, incomplete loading, and it does not often return a specific error. I have experience of connecting tens of thousands of pages of the site to turbo pages, this resulted in writing functionality that forms normal, valid text from articles (long sentences are broken, there was a lot of trouble with this), embedded images are checked for response before sending (yes, and this important too). It is also worth paying attention to the obsolescence of the API reference, which needs to be received approximately once an hour, and the inability to work normally in test mode. There are a lot of nuances, but by overcoming them you can see the satisfied smile of the SEO specialist, which is worth a lot)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question