fix: Update Shopify App search description selector (#20814)

This commit is contained in:
Shine 2026-01-05 23:26:24 +08:00 committed by GitHub
parent ffb226c32c
commit d6a665b772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -50,7 +50,6 @@ async function handler(ctx: Context): Promise<Data> {
.map((item) => {
const handle = $(item).attr('data-app-card-handle-value');
// const appInfo = $(item).find('div.tw-transition-colors.tw-text-fg-primary + div.tw-self-stretch');
const appInfo = $(item).find('div.tw-self-stretch').clone();
const rattingMatch = appInfo
@ -59,14 +58,16 @@ async function handler(ctx: Context): Promise<Data> {
.match(/\d\.\d/);
const rattingCountMatch = appInfo.find('span + span.tw-sr-only').text().match(/\d+/);
const description = $(item).find(`div.tw-text-fg-secondary:not(.tw-mb-md)`).eq(1).text().trim();
const result: DataItem = {
title: $(item).attr('data-app-card-name-value') ?? '',
link: `${baseURL}/${handle}`,
description: $(item).find(`div.tw-text-fg-tertiary`).first().text().trim(),
description,
image: $(item).attr('data-app-card-icon-url-value'),
_extra: {
handle,
description: $(item).find(`div.tw-text-fg-tertiary`).first().text().trim(),
description,
built_for_shopify: $(item).find(`span.built-for-shopify-badge`).length > 0,
ratting: rattingMatch ? Number.parseFloat(rattingMatch[0]) : 0,
ratting_count: rattingCountMatch ? Number(rattingCountMatch[0]) : 0,