Fix zhihu and dribbble guid conflict (#1428)

问题路由:

```
/zhihu/collection/26444956
/dribbble/user/google
/dribbble/keyword/player
```
This commit is contained in:
imlonghao 2019-01-20 22:21:34 +08:00 committed by DIYgod
parent 7b85955fe2
commit 55ce3bdb1e
2 changed files with 9 additions and 2 deletions

View File

@ -36,7 +36,11 @@ module.exports = {
<strong>Views:</strong> ${item.find('.views').text()}<br>
<strong>Comment:</strong> ${item.find('.cmnt').text()}<br>
<strong>Favor:</strong> ${item.find('.fav').text()}`,
link: `https://dribbble.com${item.find('.dribbble-link').attr('href')}`,
link: `https://dribbble.com${item.find('.animated-target').attr('href') ||
item
.find('.extras > a')
.attr('href')
.replace('/rebounds', '')}`,
};
})
.get(),

View File

@ -27,7 +27,10 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
let linkUrl = item.find('link').attr('href') || '';
let linkUrl = item
.find('a.meta-item')
.not('a.toggle-comment')
.attr('href');
if (linkUrl.startsWith('/')) {
linkUrl = 'https://www.zhihu.com' + linkUrl;
}