Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👔 Add newsPress tag to iscnPayload #488

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions pages/nft/url/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
get iscnPayload(): ISCNRegisterPayload {
const {
title = '',
keywords = '',
author = '',
authorDescription = '',
license = '',
Expand All @@ -287,8 +286,11 @@
publisher,
type = 'CreativeWork',
} = this.iscnData
let { description = '' } = this.iscnData
let { description = '', keywords = '' } = this.iscnData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this duplicate with https://github.com/likecoin/app-like-co/pull/486/files?
Should we check if NewsPress already exists?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = this.truncate(description, 200)
if (this.isNewsPress && !keywords.includes('NewsPress')) {
keywords = keywords ? `${keywords},NewsPress` : 'NewsPress';
}
return {
type,
name: title,
Expand Down Expand Up @@ -416,7 +418,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 421 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
}
Expand Down Expand Up @@ -650,11 +652,7 @@
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 }
Expand Down Expand Up @@ -753,7 +751,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 754 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
} catch (err) {
Expand Down Expand Up @@ -811,7 +809,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 812 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
logTrackerEvent(this, 'NFTUrlMint', 'RegisterISCNSuccess', this.iscnId, 1);
Expand Down
Loading