MCPcopy Create free account
hub / github.com/DIYgod/RSSHub / processList

Function processList

lib/routes/30secondsofcode/utils.ts:10–20  ·  view source on GitHub ↗
(listElements)

Source from the content-addressed store, hash-verified

8export const rootUrl = 'https://www.30secondsofcode.org';
9
10export async function processList(listElements) {
11 const items = await Promise.allSettled(
12 listElements.map((item) => {
13 const $ = load(item);
14 const link = $(' article > h3 > a').attr('href');
15 const date = $(' article > small > time').attr('datetime');
16 return processItem({ link, date });
17 })
18 );
19 return items.map((item) => (item.status === 'fulfilled' ? item.value : ({ title: 'Error Reading Item' } as DataItem)));
20}
21
22async function processItem({ link: articleLink, date }) {
23 return await cache.tryGet(`30secondsofcode:${articleLink}`, async () => {

Callers 2

handlerFunction · 0.90
handlerFunction · 0.90

Calls 3

$Function · 0.85
processItemFunction · 0.70
loadFunction · 0.50

Tested by

no test coverage detected