(data)
| 66 | } |
| 67 | |
| 68 | async 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 | |
| 84 | async function saveComment(post) { |
| 85 | db = await dbPromise; |
no test coverage detected