Fix post parsing and package.json meta links
This commit is contained in:
parent
ff51e38e9c
commit
be62c12b9e
14
package.json
14
package.json
@ -8,13 +8,13 @@
|
|||||||
"page": "https://github.com/TuxedoTako/4chan-xt",
|
"page": "https://github.com/TuxedoTako/4chan-xt",
|
||||||
"downloads": "https://github.com/TuxedoTako/4chan-xt/releases",
|
"downloads": "https://github.com/TuxedoTako/4chan-xt/releases",
|
||||||
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
|
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
|
||||||
"faq": "https://github.com/TuxedoTako/wiki/Frequently-Asked-Questions",
|
"faq": "https://github.com/TuxedoTako/4chan-xt/wiki/Frequently-Asked-Questions",
|
||||||
"captchaFAQ": "https://github.com/TuxedoTako/wiki/Captcha-FAQ",
|
"captchaFAQ": "https://github.com/TuxedoTako/4chan-xt/wiki/Captcha-FAQ",
|
||||||
"cssGuide": "https://github.com/TuxedoTako/wiki/Styling-Guide",
|
"cssGuide": "https://github.com/TuxedoTako/4chan-xt/wiki/Styling-Guide",
|
||||||
"license": "https://github.com/TuxedoTako/blob/master/LICENSE",
|
"license": "https://github.com/TuxedoTako/4chan-xt/blob/master/LICENSE",
|
||||||
"changelog": "https://github.com/TuxedoTako/blob/master/CHANGELOG.md",
|
"changelog": "https://github.com/TuxedoTako/4chan-xt/blob/master/CHANGELOG.md",
|
||||||
"issues": "https://github.com/TuxedoTako/issues",
|
"issues": "https://github.com/TuxedoTako/4chan-xt/issues",
|
||||||
"newIssue": "https://github.com/TuxedoTako/issues",
|
"newIssue": "https://github.com/TuxedoTako/4chan-xt/issues",
|
||||||
"newIssueMaxLength": 8181,
|
"newIssueMaxLength": 8181,
|
||||||
"alternatives": "https://www.4chan-x.net/4chan_alternatives.html",
|
"alternatives": "https://www.4chan-x.net/4chan_alternatives.html",
|
||||||
"appid": "lacclbnghgdicfifcamcmcnilckjamag",
|
"appid": "lacclbnghgdicfifcamcmcnilckjamag",
|
||||||
|
|||||||
@ -95,11 +95,14 @@ export default class Post {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const name = this.nodes.name?.textContent;
|
||||||
|
const tripcode = this.nodes.tripcode?.textContent;
|
||||||
|
|
||||||
this.info = {
|
this.info = {
|
||||||
subject: this.nodes.subject?.textContent || undefined,
|
subject: this.nodes.subject?.textContent || undefined,
|
||||||
name: this.nodes.name?.textContent,
|
name,
|
||||||
email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : undefined,
|
email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : undefined,
|
||||||
tripcode: this.nodes.tripcode?.textContent,
|
tripcode,
|
||||||
uniqueID: this.nodes.uniqueID?.textContent,
|
uniqueID: this.nodes.uniqueID?.textContent,
|
||||||
capcode: this.nodes.capcode?.textContent.replace('## ', ''),
|
capcode: this.nodes.capcode?.textContent.replace('## ', ''),
|
||||||
pass: this.nodes.pass?.title.match(/\d*$/)[0],
|
pass: this.nodes.pass?.title.match(/\d*$/)[0],
|
||||||
@ -107,7 +110,7 @@ export default class Post {
|
|||||||
flagCodeTroll: this.nodes.flag?.className.match(/bfl-(\w+)/)?.[1].toUpperCase(),
|
flagCodeTroll: this.nodes.flag?.className.match(/bfl-(\w+)/)?.[1].toUpperCase(),
|
||||||
flag: this.nodes.flag?.title,
|
flag: this.nodes.flag?.title,
|
||||||
date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : undefined,
|
date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : undefined,
|
||||||
nameBlock: Conf['Anonymize'] ? 'Anonymous' : `${this.info.name || ''} ${this.info.tripcode || ''}`.trim(),
|
nameBlock: Conf['Anonymize'] ? 'Anonymous' : `${name || ''} ${tripcode || ''}`.trim(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.info.capcode) { this.info.nameBlock += ` ## ${this.info.capcode}`; }
|
if (this.info.capcode) { this.info.nameBlock += ` ## ${this.info.capcode}`; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user