Skip to content

Commit d3c9633

Browse files
author
harry-yoon
committed
🎨 ts 파일 포매팅 변경
1 parent ecf6940 commit d3c9633

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/yozm/index.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
import { ObjType } from '@/type';
2-
import { getHtml } from '@/utils/lib';
3-
import { MAX_DESC_LENGTH } from '@/utils/static';
4-
import * as cheerio from 'cheerio';
1+
import { ObjType } from "@/type";
2+
import { getHtml } from "@/utils/lib";
3+
import { MAX_DESC_LENGTH } from "@/utils/static";
4+
import * as cheerio from "cheerio";
55

66
export const getYozmList = async () => {
7-
const yozm = 'https://yozm.wishket.com';
7+
const yozm = "https://yozm.wishket.com";
88
const result: ObjType[] = [];
9-
const html = await getHtml(yozm + '/magazine/list/develop');
9+
const html = await getHtml(yozm + "/magazine/list/develop");
1010
const $ = cheerio.load(html?.data);
11-
const $bodyList = $('div.list-cover ').children('div.list-item-link');
11+
const $bodyList = $("div.list-cover ").children("div.list-item-link");
1212

1313
$bodyList.each((i, elem) => {
1414
result.push({
15-
title: $(elem).find('.list-item .item-main a.item-title').text(),
16-
desc: $(elem).find('.list-item .item-description').text().slice(0, MAX_DESC_LENGTH) + '...',
17-
url: yozm + $(elem).find('.list-item .item-main a.item-title').attr('href'),
15+
title: $(elem).find(".list-item .item-main a.item-title").text(),
16+
desc:
17+
$(elem)
18+
.find(".list-item .item-description")
19+
.text()
20+
.slice(0, MAX_DESC_LENGTH) + "...",
21+
url:
22+
yozm + $(elem).find(".list-item .item-main a.item-title").attr("href"),
1823
});
1924
});
2025
return result;

0 commit comments

Comments
 (0)