Skip to content

Commit

Permalink
JTBC 모바일 사이트 지원 (#360)
Browse files Browse the repository at this point in the history
JTBC 모바일 사이트 지원
  • Loading branch information
disjukr authored Aug 15, 2019
2 parents 29f39bd + 9f4f70b commit 2304020
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/impl/JTBC-모바일.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as $ from 'jquery';
import * as moment from 'moment';

import {
Article,
ReadyToParse,
} from '..';
import {
clearStyles,
parseTimestamp,
} from '../util';


export const readyToParse: ReadyToParse = wait => wait('.sns_area');

// 사이드바 후처리
export const cleanup = () => $('#sidr').remove();

export function parse(): Article {
const articleBodyElement = $('#article_content_area')[0].cloneNode(true) as HTMLElement;
return {
title: $('.artical_hd > h3').text(),
content: (() => {
{ // 광고
$('[id^=mobonDivBanner_]', articleBodyElement).remove();
}
return clearStyles(articleBodyElement).innerHTML;
})(),
timestamp: parseTimestamp($('.author').text())
};
}
3 changes: 2 additions & 1 deletion src/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export default {
// i
'ITWORLD': ['www.itworld.co.kr/news/*'],
// j
'JTBC': ['news.jtbc.joins.com/article/*', 'news.jtbc.joins.com/html/*'],
'JTBC': ['news.jtbc.joins.com/article/*', 'news.jtbc.joins.com/html/*'],
'JTBC-모바일': ['mnews.jtbc.joins.com/News/Article.aspx?*'],
// k
'KBS': ['news.kbs.co.kr/news/view.do?*'],
'KBS World': ['world.kbs.co.kr/*/news/news_*_detail.htm*'],
Expand Down

0 comments on commit 2304020

Please sign in to comment.