From 0f353ca9cf7a659218dce45fe3c9a0a85e595134 Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Sun, 29 Sep 2024 23:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20newsPress=20tag=20to=20isc?= =?UTF-8?q?nPayload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nft/url/index.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pages/nft/url/index.vue b/pages/nft/url/index.vue index 541f903f..dc4e2457 100644 --- a/pages/nft/url/index.vue +++ b/pages/nft/url/index.vue @@ -277,7 +277,6 @@ export default class FetchIndex extends Vue { get iscnPayload(): ISCNRegisterPayload { const { title = '', - keywords = '', author = '', authorDescription = '', license = '', @@ -287,8 +286,11 @@ export default class FetchIndex extends Vue { publisher, type = 'CreativeWork', } = this.iscnData - let { description = '' } = this.iscnData + let { description = '', keywords = '' } = this.iscnData description = this.truncate(description, 200) + if (this.isNewsPress) { + keywords = keywords ? `${keywords},NewsPress` : 'NewsPress'; + } return { type, name: title, @@ -650,11 +652,7 @@ export default class FetchIndex extends Vue { try { logTrackerEvent(this, 'NFTUrlMint', 'CrawlUrlData', this.url, 1); const { data } = await this.$axios.get(`/crawler/?url=${encodeURIComponent(this.encodedURL)}&wallet=${this.address}`) - const { title, description, author, body, images = [] } = data; - let { keywords } = data; - if (this.isNewsPress) { - keywords = keywords ? `${keywords},NewsPress` : 'NewsPress'; - } + const { title, description, author, body, images = [], keywords } = data; if (!body) { throw new Error('CANNOT_CRAWL_THIS_URL') } if (title === 'patreon.com' && description === '') { throw new Error('SITE_NOT_CRAWLABLE: pateron') } this.iscnData = { title, description, keywords, author }