kk
This commit is contained in:
parent
952d71c9eb
commit
a47183886d
@ -14,7 +14,7 @@ var db = new db_js("rss_chan");
|
||||
|
||||
const get_rss = function(url,min_id){
|
||||
return parser.parseURL(url).then(feed=>feed.items).then(items=>{
|
||||
let idx = items.findIndex(i => i.prop_1 === min_id);
|
||||
let idx = items.findIndex(i => parseInt(i.guid) === min_id);
|
||||
if(idx>=0) return items.slice(0,idx);
|
||||
else return items;
|
||||
});
|
||||
|
12
manual.js
12
manual.js
@ -33,12 +33,12 @@ const get_url = function(opts){
|
||||
}
|
||||
|
||||
const get_rss = function(url,min_id){
|
||||
return parser.parseURL(url).then(feed=>feed.items
|
||||
.sort((a, b)=>(parseInt(a.guid)-parseInt(b.guid)))
|
||||
.filter((v)=>(parseInt(v.guid)>min_id)));
|
||||
return parser.parseURL(url).then(feed=>feed.items).then(items=>{
|
||||
let idx = items.findIndex(i => parseInt(i.guid) === min_id);
|
||||
if(idx>=0) return items.slice(0,idx);
|
||||
else return items;
|
||||
});
|
||||
}
|
||||
console.log(get_url({org:ORG.BR, lang:'de',since:-2}))
|
||||
|
||||
get_rss(get_url({org:ORG.BR, lang:'de',since:-2}),79710).then(r=>r.forEach(item=>{
|
||||
get_rss(get_url({org:ORG.BR, lang:'de',since:-3}),79718).then(r=>r.forEach(item=>{
|
||||
console.log(`${item.title} (${item.guid}): ${item.link}`);
|
||||
}));
|
||||
|
Loading…
x
Reference in New Issue
Block a user