Comparing version 1.0.7 to 1.0.8
@@ -1,1 +0,1 @@ | ||
{"/home/la/projects/turbo-rss/lib/index.js":{"path":"/home/la/projects/turbo-rss/lib/index.js","s":{"1":1,"2":1,"3":10,"4":6,"5":1,"6":2,"7":4,"8":2,"9":1,"10":2,"11":1,"12":5,"13":4,"14":4,"15":4,"16":4,"17":4,"18":4,"19":4,"20":4,"21":4,"22":2,"23":4,"24":1,"25":4,"26":4,"27":4,"28":2,"29":4,"30":1,"31":5,"32":5,"33":5,"34":5,"35":5,"36":5,"37":5,"38":5,"39":1,"40":4,"41":4,"42":4,"43":4,"44":4,"45":4,"46":4,"47":4,"48":4,"49":4,"50":4,"51":5,"52":1},"b":{"1":[6,4],"2":[1,1],"3":[2,2],"4":[1,3],"5":[2,2],"6":[5,2],"7":[5,2],"8":[4,1],"9":[4,1],"10":[4,1],"11":[4,4],"12":[4,1],"13":[4,2],"14":[4,4],"15":[4,2],"16":[4,3]},"f":{"1":10,"2":2,"3":4,"4":5,"5":4,"6":5,"7":4,"8":4,"9":5},"fnMap":{"1":{"name":"ifTruePush","line":11,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":44}}},"2":{"name":"addRelated","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":56}}},"3":{"name":"(anonymous_3)","line":23,"loc":{"start":{"line":23,"column":36},"end":{"line":23,"column":51}}},"4":{"name":"items","line":48,"loc":{"start":{"line":48,"column":0},"end":{"line":48,"column":31}}},"5":{"name":"(anonymous_5)","line":49,"loc":{"start":{"line":49,"column":18},"end":{"line":49,"column":34}}},"6":{"name":"generateXML","line":85,"loc":{"start":{"line":85,"column":0},"end":{"line":85,"column":27}}},"7":{"name":"YTurbo","line":117,"loc":{"start":{"line":117,"column":0},"end":{"line":117,"column":32}}},"8":{"name":"(anonymous_8)","line":125,"loc":{"start":{"line":125,"column":16},"end":{"line":125,"column":32}}},"9":{"name":"(anonymous_9)","line":144,"loc":{"start":{"line":144,"column":15},"end":{"line":144,"column":27}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"2":{"start":{"line":11,"column":0},"end":{"line":15,"column":1}},"3":{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},"4":{"start":{"line":13,"column":8},"end":{"line":13,"column":25}},"5":{"start":{"line":22,"column":0},"end":{"line":41,"column":1}},"6":{"start":{"line":23,"column":4},"end":{"line":32,"column":7}},"7":{"start":{"line":24,"column":8},"end":{"line":31,"column":10}},"8":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}},"9":{"start":{"line":35,"column":8},"end":{"line":37,"column":11}},"10":{"start":{"line":40,"column":4},"end":{"line":40,"column":71}},"11":{"start":{"line":48,"column":0},"end":{"line":79,"column":1}},"12":{"start":{"line":49,"column":4},"end":{"line":78,"column":7}},"13":{"start":{"line":50,"column":8},"end":{"line":50,"column":29}},"14":{"start":{"line":51,"column":8},"end":{"line":51,"column":53}},"15":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"16":{"start":{"line":53,"column":8},"end":{"line":53,"column":53}},"17":{"start":{"line":55,"column":8},"end":{"line":55,"column":89}},"18":{"start":{"line":56,"column":8},"end":{"line":56,"column":68}},"19":{"start":{"line":58,"column":8},"end":{"line":58,"column":21}},"20":{"start":{"line":59,"column":8},"end":{"line":59,"column":22}},"21":{"start":{"line":61,"column":8},"end":{"line":63,"column":9}},"22":{"start":{"line":62,"column":12},"end":{"line":62,"column":74}},"23":{"start":{"line":65,"column":8},"end":{"line":67,"column":9}},"24":{"start":{"line":66,"column":12},"end":{"line":66,"column":52}},"25":{"start":{"line":69,"column":8},"end":{"line":69,"column":112}},"26":{"start":{"line":71,"column":8},"end":{"line":71,"column":67}},"27":{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},"28":{"start":{"line":74,"column":12},"end":{"line":74,"column":70}},"29":{"start":{"line":77,"column":8},"end":{"line":77,"column":42}},"30":{"start":{"line":85,"column":0},"end":{"line":109,"column":1}},"31":{"start":{"line":87,"column":4},"end":{"line":87,"column":21}},"32":{"start":{"line":89,"column":4},"end":{"line":89,"column":48}},"33":{"start":{"line":90,"column":4},"end":{"line":90,"column":78}},"34":{"start":{"line":91,"column":4},"end":{"line":91,"column":74}},"35":{"start":{"line":92,"column":4},"end":{"line":92,"column":35}},"36":{"start":{"line":94,"column":4},"end":{"line":94,"column":31}},"37":{"start":{"line":96,"column":4},"end":{"line":101,"column":6}},"38":{"start":{"line":103,"column":4},"end":{"line":108,"column":6}},"39":{"start":{"line":117,"column":0},"end":{"line":147,"column":1}},"40":{"start":{"line":118,"column":4},"end":{"line":118,"column":28}},"41":{"start":{"line":120,"column":4},"end":{"line":120,"column":45}},"42":{"start":{"line":121,"column":4},"end":{"line":121,"column":49}},"43":{"start":{"line":122,"column":4},"end":{"line":122,"column":29}},"44":{"start":{"line":123,"column":4},"end":{"line":123,"column":29}},"45":{"start":{"line":125,"column":4},"end":{"line":142,"column":6}},"46":{"start":{"line":126,"column":8},"end":{"line":126,"column":26}},"47":{"start":{"line":127,"column":8},"end":{"line":138,"column":10}},"48":{"start":{"line":140,"column":8},"end":{"line":140,"column":30}},"49":{"start":{"line":141,"column":8},"end":{"line":141,"column":20}},"50":{"start":{"line":144,"column":4},"end":{"line":146,"column":6}},"51":{"start":{"line":145,"column":8},"end":{"line":145,"column":38}},"52":{"start":{"line":149,"column":0},"end":{"line":149,"column":24}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":4}},{"start":{"line":12,"column":4},"end":{"line":12,"column":4}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"3":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"4":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"5":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"6":{"line":90,"type":"binary-expr","locations":[{"start":{"line":90,"column":24},"end":{"line":90,"column":33}},{"start":{"line":90,"column":37},"end":{"line":90,"column":75}}]},"7":{"line":91,"type":"binary-expr","locations":[{"start":{"line":91,"column":40},"end":{"line":91,"column":56}},{"start":{"line":91,"column":60},"end":{"line":91,"column":70}}]},"8":{"line":118,"type":"binary-expr","locations":[{"start":{"line":118,"column":14},"end":{"line":118,"column":21}},{"start":{"line":118,"column":25},"end":{"line":118,"column":27}}]},"9":{"line":120,"type":"binary-expr","locations":[{"start":{"line":120,"column":17},"end":{"line":120,"column":30}},{"start":{"line":120,"column":34},"end":{"line":120,"column":44}}]},"10":{"line":121,"type":"binary-expr","locations":[{"start":{"line":121,"column":23},"end":{"line":121,"column":42}},{"start":{"line":121,"column":46},"end":{"line":121,"column":48}}]},"11":{"line":123,"type":"binary-expr","locations":[{"start":{"line":123,"column":17},"end":{"line":123,"column":22}},{"start":{"line":123,"column":26},"end":{"line":123,"column":28}}]},"12":{"line":126,"type":"binary-expr","locations":[{"start":{"line":126,"column":15},"end":{"line":126,"column":19}},{"start":{"line":126,"column":23},"end":{"line":126,"column":25}}]},"13":{"line":128,"type":"binary-expr","locations":[{"start":{"line":128,"column":19},"end":{"line":128,"column":29}},{"start":{"line":128,"column":33},"end":{"line":128,"column":43}}]},"14":{"line":129,"type":"binary-expr","locations":[{"start":{"line":129,"column":25},"end":{"line":129,"column":41}},{"start":{"line":129,"column":45},"end":{"line":129,"column":47}}]},"15":{"line":133,"type":"binary-expr","locations":[{"start":{"line":133,"column":18},"end":{"line":133,"column":27}},{"start":{"line":133,"column":31},"end":{"line":133,"column":43}}]},"16":{"line":137,"type":"binary-expr","locations":[{"start":{"line":137,"column":27},"end":{"line":137,"column":45}},{"start":{"line":137,"column":49},"end":{"line":137,"column":54}}]}}}} | ||
{"/home/rain/workfolder/web/turbo-rss/lib/index.js":{"path":"/home/rain/workfolder/web/turbo-rss/lib/index.js","s":{"1":1,"2":1,"3":27,"4":9,"5":1,"6":3,"7":6,"8":3,"9":2,"10":3,"11":1,"12":6,"13":6,"14":6,"15":6,"16":6,"17":6,"18":6,"19":6,"20":6,"21":6,"22":6,"23":3,"24":6,"25":1,"26":2,"27":6,"28":6,"29":6,"30":3,"31":6,"32":1,"33":6,"34":6,"35":6,"36":6,"37":6,"38":6,"39":6,"40":6,"41":1,"42":5,"43":5,"44":5,"45":5,"46":5,"47":5,"48":5,"49":6,"50":6,"51":6,"52":6,"53":5,"54":6,"55":1},"b":{"1":[9,18],"2":[2,1],"3":[3,3],"4":[1,5],"5":[3,3],"6":[6,2],"7":[5,1],"8":[5,1],"9":[5,1],"10":[5,1],"11":[5,5],"12":[5,5],"13":[6,1],"14":[6,3],"15":[6,6],"16":[6,3],"17":[6,3],"18":[6,4],"19":[6,6],"20":[6,6]},"f":{"1":27,"2":3,"3":6,"4":6,"5":6,"6":2,"7":6,"8":5,"9":6,"10":6},"fnMap":{"1":{"name":"ifTruePush","line":11,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":44}}},"2":{"name":"addRelated","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":56}}},"3":{"name":"(anonymous_3)","line":23,"loc":{"start":{"line":23,"column":36},"end":{"line":23,"column":51}}},"4":{"name":"items","line":48,"loc":{"start":{"line":48,"column":0},"end":{"line":48,"column":31}}},"5":{"name":"(anonymous_5)","line":49,"loc":{"start":{"line":49,"column":18},"end":{"line":49,"column":34}}},"6":{"name":"(anonymous_6)","line":67,"loc":{"start":{"line":67,"column":44},"end":{"line":67,"column":60}}},"7":{"name":"generateXML","line":88,"loc":{"start":{"line":88,"column":0},"end":{"line":88,"column":27}}},"8":{"name":"TR","line":120,"loc":{"start":{"line":120,"column":0},"end":{"line":120,"column":28}}},"9":{"name":"(anonymous_9)","line":130,"loc":{"start":{"line":130,"column":16},"end":{"line":130,"column":32}}},"10":{"name":"(anonymous_10)","line":151,"loc":{"start":{"line":151,"column":15},"end":{"line":151,"column":27}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"2":{"start":{"line":11,"column":0},"end":{"line":15,"column":1}},"3":{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},"4":{"start":{"line":13,"column":8},"end":{"line":13,"column":25}},"5":{"start":{"line":22,"column":0},"end":{"line":41,"column":1}},"6":{"start":{"line":23,"column":4},"end":{"line":32,"column":7}},"7":{"start":{"line":24,"column":8},"end":{"line":31,"column":10}},"8":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}},"9":{"start":{"line":35,"column":8},"end":{"line":37,"column":11}},"10":{"start":{"line":40,"column":4},"end":{"line":40,"column":71}},"11":{"start":{"line":48,"column":0},"end":{"line":82,"column":1}},"12":{"start":{"line":49,"column":4},"end":{"line":81,"column":7}},"13":{"start":{"line":50,"column":8},"end":{"line":50,"column":29}},"14":{"start":{"line":51,"column":8},"end":{"line":51,"column":53}},"15":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"16":{"start":{"line":54,"column":8},"end":{"line":54,"column":86}},"17":{"start":{"line":55,"column":8},"end":{"line":55,"column":83}},"18":{"start":{"line":56,"column":8},"end":{"line":56,"column":89}},"19":{"start":{"line":57,"column":8},"end":{"line":57,"column":68}},"20":{"start":{"line":59,"column":8},"end":{"line":59,"column":21}},"21":{"start":{"line":60,"column":8},"end":{"line":60,"column":22}},"22":{"start":{"line":62,"column":8},"end":{"line":64,"column":9}},"23":{"start":{"line":63,"column":12},"end":{"line":63,"column":74}},"24":{"start":{"line":66,"column":8},"end":{"line":70,"column":9}},"25":{"start":{"line":67,"column":12},"end":{"line":69,"column":36}},"26":{"start":{"line":68,"column":16},"end":{"line":68,"column":75}},"27":{"start":{"line":72,"column":8},"end":{"line":72,"column":112}},"28":{"start":{"line":74,"column":8},"end":{"line":74,"column":67}},"29":{"start":{"line":76,"column":8},"end":{"line":78,"column":9}},"30":{"start":{"line":77,"column":12},"end":{"line":77,"column":70}},"31":{"start":{"line":80,"column":8},"end":{"line":80,"column":42}},"32":{"start":{"line":88,"column":0},"end":{"line":112,"column":1}},"33":{"start":{"line":90,"column":4},"end":{"line":90,"column":21}},"34":{"start":{"line":92,"column":4},"end":{"line":92,"column":48}},"35":{"start":{"line":93,"column":4},"end":{"line":93,"column":36}},"36":{"start":{"line":94,"column":4},"end":{"line":94,"column":74}},"37":{"start":{"line":95,"column":4},"end":{"line":95,"column":44}},"38":{"start":{"line":97,"column":4},"end":{"line":97,"column":31}},"39":{"start":{"line":99,"column":4},"end":{"line":104,"column":6}},"40":{"start":{"line":106,"column":4},"end":{"line":111,"column":6}},"41":{"start":{"line":120,"column":0},"end":{"line":154,"column":1}},"42":{"start":{"line":121,"column":4},"end":{"line":121,"column":28}},"43":{"start":{"line":123,"column":4},"end":{"line":123,"column":37}},"44":{"start":{"line":124,"column":4},"end":{"line":124,"column":35}},"45":{"start":{"line":125,"column":4},"end":{"line":125,"column":49}},"46":{"start":{"line":126,"column":4},"end":{"line":126,"column":45}},"47":{"start":{"line":128,"column":4},"end":{"line":128,"column":29}},"48":{"start":{"line":130,"column":4},"end":{"line":149,"column":6}},"49":{"start":{"line":131,"column":8},"end":{"line":131,"column":26}},"50":{"start":{"line":132,"column":8},"end":{"line":145,"column":10}},"51":{"start":{"line":147,"column":8},"end":{"line":147,"column":30}},"52":{"start":{"line":148,"column":8},"end":{"line":148,"column":20}},"53":{"start":{"line":151,"column":4},"end":{"line":153,"column":6}},"54":{"start":{"line":152,"column":8},"end":{"line":152,"column":38}},"55":{"start":{"line":156,"column":0},"end":{"line":156,"column":20}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":4}},{"start":{"line":12,"column":4},"end":{"line":12,"column":4}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"3":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"4":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"5":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"6":{"line":94,"type":"binary-expr","locations":[{"start":{"line":94,"column":40},"end":{"line":94,"column":56}},{"start":{"line":94,"column":60},"end":{"line":94,"column":70}}]},"7":{"line":121,"type":"binary-expr","locations":[{"start":{"line":121,"column":14},"end":{"line":121,"column":21}},{"start":{"line":121,"column":25},"end":{"line":121,"column":27}}]},"8":{"line":123,"type":"binary-expr","locations":[{"start":{"line":123,"column":17},"end":{"line":123,"column":30}},{"start":{"line":123,"column":34},"end":{"line":123,"column":36}}]},"9":{"line":124,"type":"binary-expr","locations":[{"start":{"line":124,"column":16},"end":{"line":124,"column":28}},{"start":{"line":124,"column":32},"end":{"line":124,"column":34}}]},"10":{"line":125,"type":"binary-expr","locations":[{"start":{"line":125,"column":23},"end":{"line":125,"column":42}},{"start":{"line":125,"column":46},"end":{"line":125,"column":48}}]},"11":{"line":126,"type":"binary-expr","locations":[{"start":{"line":126,"column":20},"end":{"line":126,"column":36}},{"start":{"line":126,"column":40},"end":{"line":126,"column":44}}]},"12":{"line":128,"type":"binary-expr","locations":[{"start":{"line":128,"column":17},"end":{"line":128,"column":22}},{"start":{"line":128,"column":26},"end":{"line":128,"column":28}}]},"13":{"line":131,"type":"binary-expr","locations":[{"start":{"line":131,"column":15},"end":{"line":131,"column":19}},{"start":{"line":131,"column":23},"end":{"line":131,"column":25}}]},"14":{"line":133,"type":"binary-expr","locations":[{"start":{"line":133,"column":19},"end":{"line":133,"column":29}},{"start":{"line":133,"column":33},"end":{"line":133,"column":35}}]},"15":{"line":134,"type":"binary-expr","locations":[{"start":{"line":134,"column":25},"end":{"line":134,"column":41}},{"start":{"line":134,"column":45},"end":{"line":134,"column":47}}]},"16":{"line":136,"type":"binary-expr","locations":[{"start":{"line":136,"column":17},"end":{"line":136,"column":25}},{"start":{"line":136,"column":29},"end":{"line":136,"column":38}}]},"17":{"line":138,"type":"binary-expr","locations":[{"start":{"line":138,"column":18},"end":{"line":138,"column":27}},{"start":{"line":138,"column":31},"end":{"line":138,"column":43}}]},"18":{"line":142,"type":"binary-expr","locations":[{"start":{"line":142,"column":27},"end":{"line":142,"column":45}},{"start":{"line":142,"column":49},"end":{"line":142,"column":54}}]},"19":{"line":143,"type":"binary-expr","locations":[{"start":{"line":143,"column":25},"end":{"line":143,"column":41}},{"start":{"line":143,"column":45},"end":{"line":143,"column":47}}]},"20":{"line":144,"type":"binary-expr","locations":[{"start":{"line":144,"column":24},"end":{"line":144,"column":39}},{"start":{"line":144,"column":43},"end":{"line":144,"column":45}}]}}}} |
@@ -53,4 +53,5 @@ 'use strict'; | ||
item_values.push({link: item.url}); | ||
item_values.push({'turbo:source': item.url}); | ||
ifTruePush(item.turboSource, item_values, {'turbo:source': item.turboSource}); | ||
ifTruePush(item.turboTopic, item_values, {'turbo:topic': item.turboTopic}); | ||
ifTruePush(item.date, item_values, {pubDate: new Date(item.date).toUTCString()}); | ||
@@ -66,4 +67,6 @@ ifTruePush(item.author, item_values, {author: item.author}); | ||
if (item.menu) { | ||
menu = '<menu>' + item.menu + '</menu>'; | ||
if (Array.isArray(item.menu)) { | ||
menu = '<menu>' + item.menu.map(function (item) { | ||
return '<a href="' + item.link + '">' + item.text + '</a>'; | ||
}).join('') + '</menu>'; | ||
} | ||
@@ -92,5 +95,5 @@ | ||
channel.push({title: {_cdata: data.title}}); | ||
channel.push({link: data.link || 'http://github.com/LightAir/turbo-rss'}); | ||
channel.push({link: data.link}); | ||
channel.push({description: {_cdata: data.description || data.title}}); | ||
channel.push({language: 'ru'}); | ||
channel.push({language: data.language}); | ||
@@ -120,8 +123,10 @@ items(data.items, channel); | ||
*/ | ||
function YTurbo(options, items) { | ||
function TR(options, items) { | ||
options = options || {}; | ||
this.title = options.title || 'Untitled'; | ||
this.title = options.title || ''; | ||
this.link = options.link || ''; | ||
this.description = options.description || ''; | ||
this.link = options.link; | ||
this.language = options.language || 'ru'; | ||
this.items = items || []; | ||
@@ -132,6 +137,6 @@ | ||
let item = { | ||
title: data.title || 'No title', | ||
title: data.title || '', | ||
description: data.description || '', | ||
image_url: data.image_url, | ||
url: data.url, | ||
url: data.url || data.link, | ||
author: data.author, | ||
@@ -143,2 +148,4 @@ date: data.date || data.pubDate, | ||
relatedfinity: data.relatedfinity || false, | ||
turboSource: data.turboSource || '', | ||
turboTopic: data.turboTopic || '' | ||
}; | ||
@@ -155,2 +162,2 @@ | ||
module.exports = YTurbo; | ||
module.exports = TR; |
{ | ||
"name": "turbo-rss", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "RSS based, feed generator for Yandex turbo", | ||
@@ -23,2 +23,3 @@ "keywords": [ | ||
"LightAir <public@softroot.ru>", | ||
"Ivan Pilyugin (aka Archer)", | ||
"Dylan Greene <dylang@gmail.com>", | ||
@@ -25,0 +26,0 @@ "Xavier Damman <xdamman@gmail.com>", |
@@ -1,3 +0,1 @@ | ||
## WIP | ||
## turbo-rss | ||
@@ -11,6 +9,4 @@ | ||
>Генератор RSS разметки для сервиса Турбо-страницы | ||
>Генератор RSS разметки для сервиса Турбо-страницы https://yandex.ru/support/webmaster/turbo/connection.html | ||
>ПРЕДУПРЕЖДЕНИЕ! Работа в процессе | ||
### Использование | ||
@@ -29,8 +25,7 @@ | ||
* `title` **string** Название RSS-канала. | ||
* `description` _optional_ **string** Описание канала одним предложением. Не используйте HTML-разметку.. | ||
* `author` _optional_ **string** If included it is the name of the item's creator. **(Будет удалено)** | ||
* `link` **url string** Домен сайта, данные которого транслируются.. | ||
* `pubDate` _optional_ **Date object or date string** The publication date for content in the feed **(Будет удалено)** | ||
* `link` **url string** Домен сайта, данные которого транслируются. | ||
* `description` _optional_ **string** Описание канала одним предложением. Не используйте HTML-разметку. | ||
* `language` _optional_ **string** Язык статьи по стандарту ISO 639-1. По умолчанию ru. | ||
*Будет добавлено в новых версиях turbo:analytics, turbo:adNetwork* | ||
*Будет добавлено в новых версиях turbo:analytics, turbo:adNetwork, на текущий момент можно добавить в интерфейсе Яндекс Вебмастер* | ||
@@ -45,18 +40,25 @@ #### Добавление страницы в канал | ||
* `title` **string** Заголовок страницы. | ||
* `image_url` **url string** Адрес изображения, которое используется в качестве обложки. Изображение может быть в любом формате. | ||
* `url` **url string** URL страницы сайта, для которой нужно сформировать Турбо-страницу. | ||
* `image_url` _optional_ **url string** Адрес изображения, которое используется в качестве обложки. Изображение может быть в любом формате. | ||
* `link` **url string** URL страницы сайта, для которой нужно сформировать Турбо-страницу. | ||
* `author` _optional_ **string** Автор статьи, размещенной на странице. | ||
* `date` **string** Время публикации контента на сайте источника. | ||
* `date` или `pubDate` **string** Время публикации контента на сайте источника. Передается в формате RFC-822. | ||
* `content` **string** Содержимое страницы | ||
* `related` _optional_ **array** Аффилированные ссылки `yandex:related` в конце статьи. | ||
* `menu` _optional_ **array** Внимание! Меню будет отображаться только в том случае, если в настройках на странице Яндекс Вебмастер -> Турбо-страницы -> Настройки, содержимое 'Меню Турбо-страниц' пустое! | ||
* `related` _optional_ **array** Аффилированные ссылки `yandex:related` в конце статьи. Вы можете разместить ссылки на другие ресурсы или настроить отображение непрерывной ленты статей, реализованной, например с помощью AJAX. | ||
* `relatedfinity` _optional_ **bool** Непрерывная лента статей | ||
* `turboSource` _optional_ **string** URL страницы-источника, который можно передать в Яндекс.Метрику. | ||
* `turboTopic` _optional_ **string** Заголовок страницы, который можно передать в Яндекс.Метрику. | ||
###### menu array | ||
menu должен содержать массив объектов со следующими опциями: | ||
* `link` **url string** ссылка | ||
* `text` **string** текст ссылки. не должен содержать html | ||
*Будет добавлено в новых версиях turbo:source, turbo:topic, menu, pubDate как алиас date* | ||
###### related array | ||
related должен содержать массив объектов со следующими опциями: | ||
* `link` **string** ссылка на статью' | ||
* `image_url` **string** ссылка на изображение к статье | ||
* `text` **string** текст ссылки | ||
* `link` **url string** ссылка на статью | ||
* `image_url` **url string** ссылка на изображение к статье | ||
* `text` **string** текст ссылки. Не должен содержать html | ||
@@ -75,3 +77,2 @@ ##### Получение XML | ||
/* lets create feed */ | ||
var feed = new TR({ | ||
@@ -83,3 +84,2 @@ title: 'title', | ||
/* loop over data and add to feed */ | ||
feed.item({ | ||
@@ -92,2 +92,9 @@ title: 'item title', | ||
content: '<p>hello</p>', | ||
menu: [{ | ||
link: 'http://example.com/', | ||
text: 'Главная' | ||
}, { | ||
link: 'http://example.com/about', | ||
text: 'О сайте' | ||
}] | ||
related: [{ | ||
@@ -104,3 +111,2 @@ link: 'http://example.com/related/post1', | ||
// cache the xml to send to clients | ||
var xml = feed.xml(); | ||
@@ -111,3 +117,3 @@ ``` | ||
Для запуска тестов выполните `npm test`. На текущий момен покрытие тестами не 100% | ||
Для запуска тестов выполните `npm test`. | ||
@@ -114,0 +120,0 @@ ```sh |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
75301
574
115
0