Skip to content

Commit

Permalink
🎨 ts 파일 포매팅 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-yoon committed May 30, 2023
1 parent ecf6940 commit d3c9633
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/yozm/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import { ObjType } from '@/type';
import { getHtml } from '@/utils/lib';
import { MAX_DESC_LENGTH } from '@/utils/static';
import * as cheerio from 'cheerio';
import { ObjType } from "@/type";
import { getHtml } from "@/utils/lib";
import { MAX_DESC_LENGTH } from "@/utils/static";
import * as cheerio from "cheerio";

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

$bodyList.each((i, elem) => {
result.push({
title: $(elem).find('.list-item .item-main a.item-title').text(),
desc: $(elem).find('.list-item .item-description').text().slice(0, MAX_DESC_LENGTH) + '...',
url: yozm + $(elem).find('.list-item .item-main a.item-title').attr('href'),
title: $(elem).find(".list-item .item-main a.item-title").text(),
desc:
$(elem)
.find(".list-item .item-description")
.text()
.slice(0, MAX_DESC_LENGTH) + "...",
url:
yozm + $(elem).find(".list-item .item-main a.item-title").attr("href"),
});
});
return result;
Expand Down

0 comments on commit d3c9633

Please sign in to comment.