diff --git a/lib/routes/qdaily/column.js b/lib/routes/qdaily/column.js index 34c4e680f..a5752097a 100644 --- a/lib/routes/qdaily/column.js +++ b/lib/routes/qdaily/column.js @@ -14,11 +14,18 @@ module.exports = async (ctx) => { const out = await Promise.all( list.map(async (item, i) => { const $ = cheerio.load(item); - const time = $('.smart-date').attr('data-origindate'); + let time = $('.smart-date').attr('data-origindate'); let title = $('.title').text(); if (!title) { title = $('.smart-dotdotdot').text(); } + if (!title) { + const mmTitle = $('.makemoney-title').text(); + const description = $('.makemoney-discription').text(); + title = mmTitle + ':' + description; + time = new Date(); + } + const itemUrl = $('a').attr('href'); const allUrl = `http://www.qdaily.com${itemUrl}`; const cache = await ctx.cache.get(allUrl); @@ -49,7 +56,12 @@ module.exports = async (ctx) => { $('.article-detail-bd .author-share').remove(); $('.article-detail-ft').remove(); - out[indexList[i]].description = $('.main .com-article-detail').html(); + if (out[indexList[i]].link.match('/weeklies/')) { + out[indexList[i]].description = $('.packery-container').html(); + } else { + out[indexList[i]].description = $('.main .com-article-detail').html(); + } + ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i])); } ctx.state.data = {