MCPcopy
hub / github.com/schn4ck/schnack / parseWP

Function parseWP

src/importer.js:68–82  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

66}
67
68async function parseWP(data) {
69 const threads = data.rss.channel.item;
70 for (let thread of threads) {
71 const comments = thread['wp:comment'];
72 if (comments) {
73 if (comments.length) {
74 const formatted = comments.map(comment => formatWPComment(comment, thread));
75 await saveComments(formatted);
76 } else {
77 const formatted = formatWPComment(comments, thread);
78 await saveComments([formatted]);
79 }
80 }
81 }
82}
83
84async function saveComment(post) {
85 db = await dbPromise;

Callers 1

runFunction · 0.85

Calls 2

formatWPCommentFunction · 0.85
saveCommentsFunction · 0.85

Tested by

no test coverage detected