feat: implement specialty content module with expanded Page entity fields, database migrations, and data import utilities
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const fs = require('fs');
|
||||
const html = fs.readFileSync('/home/x79/sisvietnamvn_01/BV_DHYD_HCM/Các chuyên khoa tại Bệnh viện Đại học Y Dược TP. Hồ Chí Minh.html', 'utf8');
|
||||
|
||||
const chunks = html.split('href="https://bvdaihoc.com.vn/chuyen-khoa/');
|
||||
for (let i = 1; i < chunks.length; i++) {
|
||||
const slug = chunks[i].split('"')[0];
|
||||
if (slug.includes('?category=')) continue;
|
||||
|
||||
const imgIdx = chunks[i].indexOf('<img ');
|
||||
if (imgIdx !== -1) {
|
||||
const srcIdx = chunks[i].indexOf('src="', imgIdx);
|
||||
if (srcIdx !== -1) {
|
||||
let src = chunks[i].substring(srcIdx + 5).split('"')[0];
|
||||
if (src.startsWith('/_next/image?url=')) {
|
||||
src = decodeURIComponent(src.replace('/_next/image?url=', '').split('&')[0]);
|
||||
}
|
||||
console.log(slug + ': ' + src);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user