Skip to content

feat: add naver webtoon - #3376

Merged
DIYgod merged 4 commits into
DIYgod:masterfrom
zfanta:webtoon-naver
Dec 7, 2019
Merged

feat: add naver webtoon#3376
DIYgod merged 4 commits into
DIYgod:masterfrom
zfanta:webtoon-naver

Conversation

@zfanta

@zfanta zfanta commented Nov 2, 2019

Copy link
Copy Markdown
Contributor

@DIYgod DIYgod left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add docs

Comment thread lib/routes/webtoons/naver.js
@zfanta

zfanta commented Nov 10, 2019

Copy link
Copy Markdown
Contributor Author

I added docs.

const domain = 'https://comic.naver.com';

async function getDescription(link) {
const { body } = await got.get(link);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use cache for invariable content here, see: https://docs.rsshub.app/en/joinus/#enable-caching

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it. please check it.

Comment thread lib/routes/webtoons/naver.js Outdated
const $ = cheerio.load(body);
return $('#comic_view_area > div.wt_viewer').html();
result = $('#comic_view_area > div.wt_viewer').html();
ctx.cache.set(key, result, Number.POSITIVE_INFINITY);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the third parameter Number.POSITIVE_INFINITY is not needed, there is a default value config.cache.contentExpire: https://github.com/DIYgod/RSSHub/blob/master/lib/middleware/cache.js#L46, controlled by external config

Number.POSITIVE_INFINITY -> config.cache.contentExpire
@DIYgod
DIYgod merged commit aeb111c into DIYgod:master Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants