Skip to content

Commit

Permalink
南农高质量使用新函数
Browse files Browse the repository at this point in the history
  • Loading branch information
redleafnew committed Jun 8, 2023
1 parent 1d8f9ed commit 203ce69
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 84 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "greenfrog",
"version": "0.12.1",
"version": "0.13.0",
"description": "Zotero plugin for update journal information from easyScholar",
"config": {
"addonName": "Green Frog",
Expand Down
9 changes: 5 additions & 4 deletions src/modules/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ export class KeyExampleFactory {
var ami = Zotero.Prefs.get(`extensions.zotero.${config.addonRef}.ami`, true);
var nssf = Zotero.Prefs.get(`extensions.zotero.${config.addonRef}.nssf`, true);

var njauHighQuality = await njauJournal(item)
// 如果得到easyScholar、影响因子、法学数据或南农数据才算更新成功
if (easyscholarData || chineseIFs ||
clsciLevel || amiLevel || nssfLevel ||
njauCore(item) || njauJournal(item)) {
njauCore(item) || njauHighQuality) {
if (emptyExtra) { item.setField('extra', '') }
n++
}
Expand Down Expand Up @@ -362,12 +363,12 @@ export class KeyExampleFactory {
}

// 大学期刊分类
// 南农核心期刊分类、高水平期刊
// 南农核心期刊分类、高水平高质量期刊
if (njauCoreShow && njauCore(item) != undefined) {
ztoolkit.ExtraField.setExtraField(item, '南农核心', njauCore(item));
}
if (njauJourShow && njauJournal(item) != undefined) {
ztoolkit.ExtraField.setExtraField(item, '南农高质量', njauJournal(item));
if (njauJourShow && njauHighQuality != undefined) {
ztoolkit.ExtraField.setExtraField(item, '南农高质量', njauHighQuality);
}

// 自定义数据集
Expand Down
169 changes: 93 additions & 76 deletions src/modules/njau.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,87 +48,104 @@ export function njauCore(item: Zotero.Item): any {
}
};
// 南京农业大学高质量期刊
export function njauJournal(item: Zotero.Item): any {
// 高质量论文一类
var highQulityOne = ['中国农业科学', '农业工程学报', '南京农业大学学报', '核农学报', '园艺学报', '微生物学报',
'生物工程学报'];
// 高质量论文二类
var highQulityTwo = ['食品与发酵工业', '微生物学通报', '中国粮油学报', '食品与生物技术学报'];
export async function njauJournal(item: Zotero.Item) {

// 高质量论文A类
var highQulityA = ['Comprehensive Reviews in Food Science and Food Safety', 'Critical Reviews in Food Science and Nutrition',
'Trends in Food Science and Technology',
'ACS Nano',
'CA: A Cancer Journal for Clinicians',
'Nature Reviews Molecular Cell Biology',
'New England Journal of Medicine',
'Nature Reviews Drug Discovery',
'Lancet',
'Nature Reviews Clinical Oncology',
'ACS Sustainable Chemistry & Engineering',
'Pharmaceuticals',
'Journal of Chromatography A',
'Journal of Industrial and Engineering Chemistry',
'Metabolic Engineering', 'Postharvest Biology and Technology', 'Journal of Agricultural and Food Chemistry',
'Food Hydrocolloids', 'Food Chemistry', 'Food Microbiology', 'Food Control', 'Food & Function', 'Microbiome', 'ISME Journal',
'Ecotoxicology and Environmental Safety', 'Colloids and surfaces B-Biointerfaces', 'Food and Chemical Toxicology',
'International Journal of Food Microbiology', 'Food Quality and Preference', 'Food Packaging and Shelf Life', 'Toxins',
'Food Research International', 'Journal of Colloid and Intereace Science', 'Journal of Food Engineering',
'Journal of Functional Foods', 'Meat Science', 'Environmental pollution', 'Nutrients',
'LWT-Food Science and Technology', 'Journal of Dairy Science', 'Journal of Food Composition and Analysis',
'Journal of the Science of Food and Agriculture', 'Poultry Science', 'Scientia Horticulturae', 'Journal of Integrative Agriculture',
'mBio', 'Free Radical Biology and Medicine', 'mSystems', 'Ultrasonics Sonochemistry', 'Journal of Experimental Botany',
'Journal of Nutritional Biochemistry', 'Foods', 'Food Reviews International', 'Food and Bioproducts Processing',
'Plant Foods for Human Nutrition', 'Microchemical Journal', 'Sensors', 'Current Opinion in Food Science'];
var pubT = item.getField('publicationTitle');
var body = `keyword=${encodeURIComponent(pubT)}`;
var resp = await Zotero.HTTP.request(
"POST",
"http://phq.njau.edu.cn/admin_getJournal.action",
{
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36 Edg/114.0.1823.37",
},
body: body,
}
);
var AllJour = resp.responseText;
return JSON.parse(AllJour)['classname'];

// 高质量论文B类
var highQulityB = ['Applied Microbiology and Biotechnology', 'Microorganisms', 'Frontiers in Microbiology', 'Food and Bioprocess Technology',
'Journal of Proteomics',
'Marine Drugs', 'Foodborne Pathogens and Disease',
'Food Analytical Methods', 'Food Science and Human Wellness', 'Food Bioscience', 'International Dairy Journal', 'Journal of Cereal Science',
'International Journal of Food Sciences and Nutrition', 'Biotechnology Progress', 'International Journal of Food Science and Technology',
'Journal of Bioscience and Bioengineering', 'Food Biophysics', 'Journal of Food Science', 'European Food Research and Technology',
'Molecules', 'Process Biochemistry', 'Coatings', 'Drying Technology', 'Horticulture Environment and Biotechnology',
'Animal Science Journal'];
// 高质量论文C类
var highQulityC = ['European Journal of Lipid Science and Technology', 'CyTA-Journal of Food', 'Journal of Food Measurement and Characterization',
'Journal of Texture Studies',
'Food Science & Nutrition'];
/*
// 高质量论文一类
var highQulityOne = ['中国农业科学', '农业工程学报', '南京农业大学学报', '核农学报', '园艺学报', '微生物学报',
'生物工程学报'];
// 高质量论文二类
var highQulityTwo = ['食品与发酵工业', '微生物学通报', '中国粮油学报', '食品与生物技术学报'];
var pubT: any = item.getField('publicationTitle');
// 高质量论文A类
var highQulityA = ['Comprehensive Reviews in Food Science and Food Safety', 'Critical Reviews in Food Science and Nutrition',
'Trends in Food Science and Technology',
'ACS Nano',
'CA: A Cancer Journal for Clinicians',
'Nature Reviews Molecular Cell Biology',
'New England Journal of Medicine',
'Nature Reviews Drug Discovery',
'Lancet',
'Nature Reviews Clinical Oncology',
'ACS Sustainable Chemistry & Engineering',
'Pharmaceuticals',
'Journal of Chromatography A',
'Journal of Industrial and Engineering Chemistry',
'Metabolic Engineering', 'Postharvest Biology and Technology', 'Journal of Agricultural and Food Chemistry',
'Food Hydrocolloids', 'Food Chemistry', 'Food Microbiology', 'Food Control', 'Food & Function', 'Microbiome', 'ISME Journal',
'Ecotoxicology and Environmental Safety', 'Colloids and surfaces B-Biointerfaces', 'Food and Chemical Toxicology',
'International Journal of Food Microbiology', 'Food Quality and Preference', 'Food Packaging and Shelf Life', 'Toxins',
'Food Research International', 'Journal of Colloid and Intereace Science', 'Journal of Food Engineering',
'Journal of Functional Foods', 'Meat Science', 'Environmental pollution', 'Nutrients',
'LWT-Food Science and Technology', 'Journal of Dairy Science', 'Journal of Food Composition and Analysis',
'Journal of the Science of Food and Agriculture', 'Poultry Science', 'Scientia Horticulturae', 'Journal of Integrative Agriculture',
'mBio', 'Free Radical Biology and Medicine', 'mSystems', 'Ultrasonics Sonochemistry', 'Journal of Experimental Botany',
'Journal of Nutritional Biochemistry', 'Foods', 'Food Reviews International', 'Food and Bioproducts Processing',
'Plant Foods for Human Nutrition', 'Microchemical Journal', 'Sensors', 'Current Opinion in Food Science'];
if (highQulityOne.includes(pubT)) {
var highQuality: any = '自然科学一类'; // 高质量论文一类
} else if (highQulityTwo.includes(pubT)) {
highQuality = '自然科学二类'; // 高质量论文二类
} else if (highQulityA.includes(pubT)) {
highQuality = '自然科学A';
} else if (highQulityB.includes(pubT)) {
highQuality = '自然科学B';
} else if (highQulityC.includes(pubT)) {
highQuality = '自然科学C';
} else {
highQuality = undefined
}
// 高质量论文B类
var highQulityB = ['Applied Microbiology and Biotechnology', 'Microorganisms', 'Frontiers in Microbiology', 'Food and Bioprocess Technology',
'Journal of Proteomics',
'Marine Drugs', 'Foodborne Pathogens and Disease',
'Food Analytical Methods', 'Food Science and Human Wellness', 'Food Bioscience', 'International Dairy Journal', 'Journal of Cereal Science',
'International Journal of Food Sciences and Nutrition', 'Biotechnology Progress', 'International Journal of Food Science and Technology',
'Journal of Bioscience and Bioengineering', 'Food Biophysics', 'Journal of Food Science', 'European Food Research and Technology',
'Molecules', 'Process Biochemistry', 'Coatings', 'Drying Technology', 'Horticulture Environment and Biotechnology',
'Animal Science Journal'];
// 高质量论文C类
var highQulityC = ['European Journal of Lipid Science and Technology', 'CyTA-Journal of Food', 'Journal of Food Measurement and Characterization',
'Journal of Texture Studies',
'Food Science & Nutrition'];
// 如果高质量期刊没有找到,尝试用&替换and
if (highQuality == undefined) {
pubT = pubT.replace('&', 'and');
if (highQulityOne.includes(pubT)) {
var highQuality: any = '自然科学一类'; // 高质量论文一类
} else if (highQulityTwo.includes(pubT)) {
highQuality = '自然科学二类'; // 高质量论文二类
} else if (highQulityA.includes(pubT)) {
highQuality = '自然科学A';
} else if (highQulityB.includes(pubT)) {
highQuality = '自然科学B';
} else if (highQulityC.includes(pubT)) {
highQuality = '自然科学C';
} else {
highQuality = undefined
}
}
var pubT: any = item.getField('publicationTitle');
if (highQulityOne.includes(pubT)) {
var highQuality: any = '自然科学一类'; // 高质量论文一类
} else if (highQulityTwo.includes(pubT)) {
highQuality = '自然科学二类'; // 高质量论文二类
} else if (highQulityA.includes(pubT)) {
highQuality = '自然科学A';
} else if (highQulityB.includes(pubT)) {
highQuality = '自然科学B';
} else if (highQulityC.includes(pubT)) {
highQuality = '自然科学C';
} else {
highQuality = undefined
}
return highQuality;
// 如果高质量期刊没有找到,尝试用&替换and
if (highQuality == undefined) {
pubT = pubT.replace('&', 'and');
if (highQulityOne.includes(pubT)) {
var highQuality: any = '自然科学一类'; // 高质量论文一类
} else if (highQulityTwo.includes(pubT)) {
highQuality = '自然科学二类'; // 高质量论文二类
} else if (highQulityA.includes(pubT)) {
highQuality = '自然科学A';
} else if (highQulityB.includes(pubT)) {
highQuality = '自然科学B';
} else if (highQulityC.includes(pubT)) {
highQuality = '自然科学C';
} else {
highQuality = undefined
}
}
return highQuality;
*/
}
4 changes: 2 additions & 2 deletions update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"[email protected]": {
"updates": [
{
"version": "0.12.1",
"version": "0.13.0",
"update_link": "https://github.com/redleafnew/zotero-updateifsE/releases/latest/download/greenfrog.xpi",
"applications": {
"gecko": {
Expand All @@ -12,7 +12,7 @@
}
},
{
"version": "0.12.1",
"version": "0.13.0",
"update_link": "https://github.com/redleafnew/zotero-updateifsE/releases/latest/download/greenfrog.xpi",
"applications": {
"zotero": {
Expand Down
2 changes: 1 addition & 1 deletion update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.12.1</em:version>
<em:version>0.13.0</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>[email protected]</em:id>
Expand Down

0 comments on commit 203ce69

Please sign in to comment.