Skip to content

Commit

Permalink
Support slownews.kr (Fix #304)
Browse files Browse the repository at this point in the history
  • Loading branch information
yous committed Feb 18, 2019
1 parent aeac041 commit 774cd8a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const cleanup = () => $('#scrollDiv, iframe').remove();
* [x] [스포츠서울](http://www.sportsseoul.com)
* [x] [스포츠조선](http://sports.chosun.com)
* [x] [스포탈코리아](http://www.sportalkorea.com)
* [ ] [슬로우뉴스](http://slownews.kr)
* [x] [시사IN Live](http://www.sisainlive.com)
* [x] [아시아경제](http://www.asiae.co.kr)
* [x] [아시아투데이](http://www.asiatoday.co.kr)
Expand Down
27 changes: 27 additions & 0 deletions src/impl/슬로우뉴스.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as $ from 'jquery';
import { clearStyles } from '../util';
import { Article } from 'index';

export const cleanup = () => {
$('#fb-root, body>iframe').remove();
}

export function parse(): Article {
return {
title: $('.cat_article_title').text(),
subtitle: undefined,
content: (() => {
const content = $($('#article_content')[0].cloneNode(true));
$('.async-wrapper, #wpdevar_comment_1, .clear', content).remove();
return clearStyles(content[0]).innerHTML;
})(),
timestamp: {
created: new Date($('.meta_date a strong').text().replace(/-/g, '/')),
lastModified: undefined
},
reporters: [{
name: $('.meta_author a[rel="author"]').text(),
mail: undefined
}]
};
}
1 change: 1 addition & 0 deletions src/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default {
'스포츠서울': ['www.sportsseoul.com/news/read/*'],
'스포츠조선': ['sports.chosun.com/news/ntype.htm*', 'sports.chosun.com/news/ntype5.htm*', 'sports.chosun.com/news/utype.htm*'],
'스포탈코리아': ['www.sportalkorea.com/news/view.php*', 'www.sportalkorea.com/newsplus/view_sub.php*'],
'슬로우뉴스': ['slownews.kr/*'],
'시사IN Live': ['www.sisainlive.com/news/articleView.html?*'],
// ㅇ
'아시아경제': ['www.asiae.co.kr/news/view.htm*', 'car.asiae.co.kr/view.htm*', 'edu.asiae.co.kr/view.htm*', 'gold.asiae.co.kr/view.htm*', 'golf.asiae.co.kr/view.htm*', 'stock.asiae.co.kr/news/view.htm*', 'view.asiae.co.kr/news/view.htm*'],
Expand Down

0 comments on commit 774cd8a

Please sign in to comment.