Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JTBC 모바일 사이트 지원 #360

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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