Files
RSSHub/lib/routes/publico/items-processor.ts
T
Adrián Rico 4fb2b3eea0 feat(route): add publico.es (#18242)
* Add new route: Spanish newspaper publico.es

* Add new route: Spanish newspaper publico.es (II)

* Add new route: Spanish newspaper publico.es (III)

* Add new route: Spanish newspaper publico.es (fix)

* Add new route: Spanish newspaper publico.es (fixes II)
2025-02-06 12:40:17 +08:00

21 lines
585 B
TypeScript

export default function getItems(data) {
const items = data('.category-list li')
.toArray()
.map((item) => {
item = data(item);
const title = item.find('h2').text();
const link = item.find('a').attr('href');
const author = item.find('p').text();
const image = item.find('picture img').attr('src');
return {
title,
link,
description: `<img src="${image}" alt="${title}">`,
author,
};
});
return items;
}