Files
RSSHub/lib/v2/behance/radar.js
MisteryMonster a60663ee91 fix(route): behance v2 & fix (#9767)
* behance v2 & fix

* behance v2 & fix

* Try get & remove old radar

* fetch limits

* fix: maintainer
2022-05-26 23:05:27 +08:00

27 lines
1.0 KiB
JavaScript

module.exports = {
'behance.net': {
_name: 'Behance',
www: [
{
title: 'User',
docs: 'https://docs.rsshub.app/design.html#behance-yong-hu-zuo-pin',
source: ['/:user', '/:user/:types', '/gallery/:galleryid/:galleryname'],
target: (params, url, document) => {
let uid;
let type = '';
if (params.types && params.types.match('appreciated')) {
type = '/appreciated';
}
if (url.match(/gallery\/\d+/)) {
uid = document && document.querySelector('.e2e-project-avatar').childNodes[0].attributes[1].value.match(/behance.net\/(.*)/)[1];
} else {
uid = document && document.querySelector('html').innerHTML.match(/([^/]+)\/insights/)[1];
}
return `/behance/${uid}${type}`;
},
},
],
},
};