-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JTBC 모바일 사이트 지원
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters