diff --git a/lib/routes/dribbble/utils.js b/lib/routes/dribbble/utils.js index ac96e50e24..069995907b 100644 --- a/lib/routes/dribbble/utils.js +++ b/lib/routes/dribbble/utils.js @@ -6,14 +6,18 @@ async function load(link) { const response = await got.get(link); const $ = cheerio.load(response.data); - const shotMedia = $('.media-shot').html(); - const shotDescription = $('.shot-desc').html(); + const shotMedia = $('.media-shot').html() || $('.main-shot').html() || ''; + const shotDescription = $('.shot-desc').html() || ''; + + const shotViews = $('.shot-views').text() || '0 views'; + const shotLikes = $('.shot-likes').text() || '0 likes'; + const shotSaves = $('.shot-saves').text() || '0 saves'; const description = `${shotMedia}
${shotDescription}
- ${$('.shot-views').text()}
- ${$('.shot-likes').text()}
- ${$('.shot-saves').text()}`; + ${shotViews}
+ ${shotLikes}
+ ${shotSaves}`; const pubDateString = $('.shot-date').text(); const pubDate = new Date(pubDateString).toUTCString();