thainv-dev: Fix

This commit is contained in:
nguyen van thai
2024-07-03 15:33:51 +07:00
parent ee5c6f40f1
commit 554ceab3c6
36 changed files with 1033 additions and 231 deletions
+11 -11
View File
@@ -1,18 +1,18 @@
import * as cherrio from 'cheerio'
const getResource = (data: any) => {
const result = {
videoHightlight: null,
imageHightlight: null,
resources: [],
};
const $ = cherrio.load(`<div class="get-resource">${data}</div>`)
const html : any = $('.get-resource').html();
html.find('video, figure img, img').each((index : any, element: any) => {
// if (index === 0) result.videoHightlight =
});
// const result = {
// videoHightlight: null,
// imageHightlight: null,
// resources: [],
// };
// const $ = cherrio.load(`<div class="get-resource">${data}</div>`)
// const html : any = $('.get-resource').html();
// html.find('video, figure img, img').each((index : any, element: any) => {
// // if (index === 0) result.videoHightlight =
// });
console.log(html)
// console.log(html)
// <div>
// <video controls="controls" width="100%" height="auto" data-id="578" data-resource="https://resource.vpress.vn/resources/1/private/13cee27a2bd93915479f049378cffdd3/video/28thi-tot-nghiep-ptth-2024-1719829616.mp4" data-title="28thi-tot-nghiep-ptth-2024">