mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix kym meme titles
This commit is contained in:
@@ -46,11 +46,7 @@ module.exports = class KnowYourMemeCommand extends Command {
|
||||
async search(query) {
|
||||
const { text } = await request
|
||||
.get('https://knowyourmeme.com/search')
|
||||
.query({
|
||||
q: query,
|
||||
sort: 'views',
|
||||
context: 'entries'
|
||||
});
|
||||
.query({ q: query });
|
||||
const $ = cheerio.load(text);
|
||||
const location = $('section[class="gallery"]').find('a[class="item"]').first().attr('href');
|
||||
if (!location) return null;
|
||||
@@ -64,7 +60,7 @@ module.exports = class KnowYourMemeCommand extends Command {
|
||||
|| $('a[class="photo left "]').first().attr('href')
|
||||
|| null;
|
||||
return {
|
||||
name: $('h1').first().text().trim(),
|
||||
name: $('h1[class="content-title entry-title"]').first().text().trim(),
|
||||
url: `https://knowyourmeme.com${location}`,
|
||||
description: this.getMemeDescription($),
|
||||
thumbnail
|
||||
|
||||
Reference in New Issue
Block a user