Skip to content

Commit

Permalink
Merge pull request #356 from x86chi/master
Browse files Browse the repository at this point in the history
경향신문 모바일 추가
  • Loading branch information
disjukr committed Aug 15, 2019
2 parents 05e4c08 + 2ae4bf8 commit 9d45aa5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions src/impl/경향신문-모바일.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import * as $ from 'jquery';
import * as moment from 'moment';

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


export const readyToParse: ReadyToParse = wait => wait('#articleBody');

export const cleanup = () => $('.pushADMiddle').remove();

export function parse(): Article {
const articleBodyElement = $('.txt_news')[0].cloneNode(true) as HTMLElement;
return {
title: $('.subject').text(),
content: (() => {
{ // 광고
$('a[title="advertise"]', articleBodyElement).remove();
$('.article_bottom_ad', articleBodyElement).remove();
}
return clearStyles(articleBodyElement).innerHTML;
})(),
timestamp: parseTimestamp($('.author').text()),
reporters: (() => {
const d = /([^<]*?) 기자 ?([^>]*)/.exec(
$('.reporter').text()
);
return [{
name: d![1],
mail: d![2],
}];
})(),
};
}
3 changes: 2 additions & 1 deletion src/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default {
// y
'YTN': ['www.ytn.co.kr/_ln/*'],
// ㄱ
'경향신문': ['biz.khan.co.kr/khan_art_view.html*', 'news.khan.co.kr/kh_news/khan_art_view.html*'],
'경향신문': ['biz.khan.co.kr/khan_art_view.html*', 'news.khan.co.kr/kh_news/khan_art_view.html*'],
'경향신문-모바일': ['m.biz.khan.co.kr/view.html*'],
'국민일보': ['news.kmib.co.kr/article/view.asp*'],
// ㄴ
'나우뉴스': ['nownews.seoul.co.kr/news/newsView.php*'],
Expand Down

0 comments on commit 9d45aa5

Please sign in to comment.