Skip to content

Commit

Permalink
fix: remove deprecated citation code. The citation is hidden in the p…
Browse files Browse the repository at this point in the history
…age.
  • Loading branch information
l0o0 committed Nov 14, 2024
1 parent 9e54a4b commit 26b0fd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
"git": {
"requireBranch": "main"
"requireBranch": "z7"
}
}
14 changes: 8 additions & 6 deletions src/modules/cnki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,12 @@ export async function updateCiteCSSCI() {
showPop(getString('nonchinese-item'), 'fail');
continue;
} else if (item.getField('url')) {
ztoolkit.log(item.getField('url'));
const url = item.getField('url') as string;
const html = await getHTMLDoc(url);
// ztoolkit.log(item.getField('url'));
// const url = item.getField('url') as string;
// const html = await getHTMLDoc(url);
// 检测是否出现知网验证页面,一般网页以nxgp开头的页面,会出现知网验证页面
if (html.querySelector('div.verify_wrap, #erro_span')) {
// if (html.querySelector('div.verify_wrap, #erro_span')) {
if (item) {
ztoolkit.log(getString('cnki-capatch-warning'));
const pubTitle = item.getField('publicationTitle');
const fileData = {
Expand All @@ -816,9 +817,10 @@ export async function updateCiteCSSCI() {
'fail',
);
}
} else {
cite = getCitationFromPage(html);
}
// } else {
// cite = getCitationFromPage(html);
// }

if (cite != null && parseInt(cite) > 0) {
await ztoolkit.ExtraField.setExtraField(item, 'CNKICite', cite);
Expand Down

0 comments on commit 26b0fd1

Please sign in to comment.