mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: Clean up the Dribbble posts a bit more. (#3622)
* Make sure to include the content of multiple media shots. * Remove extra content in the media. Co-authored-by: Logan Rockmore <dev@loganrockmore.com>
This commit is contained in:
committed by
DIYgod
co-authored by
Logan Rockmore
parent
c0fcad6c5e
commit
b04072e5fc
@@ -6,7 +6,17 @@ async function load(link) {
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const shotMedia = $('.media-shot').html() || $('.main-shot').html() || '';
|
||||
const shotMedia = $('.media-shot,.main-shot') // join multiple shots together
|
||||
.toArray()
|
||||
.map((element) => {
|
||||
const object = $(element);
|
||||
|
||||
// remove the content that we don't want to show
|
||||
object.find('span.cropped-indicator').remove();
|
||||
|
||||
return object.html();
|
||||
})
|
||||
.join('');
|
||||
const shotDescription = $('.shot-desc').html() || '';
|
||||
|
||||
const shotViews = $('.shot-views').text() || '0 views';
|
||||
|
||||
Reference in New Issue
Block a user