l0o0 / translators_CN

Zotero translator中文网页抓取翻译器🎉This is Zotero translators for Chinese Sites(beta), not the official Zotero repo
GNU Affero General Public License v3.0
4.03k stars 523 forks source link

ChinaXiv target #285

Closed doubanchan closed 8 months ago

doubanchan commented 8 months ago

你遇到了什么问题? [必填]

发生问题的链接 [必填] 核物理预印本平台

问题描述 [必填]

https://github.com/l0o0/translators_CN/blob/e1e79679c7b086aa95fc655be7b7df37a49a9362/ChinaXiv.js#L5

target需要适配另外几个子平台(核物理语音乐律研究预印本平台

你的预期结果 如:“作者”名字应该分开。

浏览器

自查清单

另外建议 提议增加一个extra,存放CSTRCSTR是国内的科技资源标识符系统,类似于DOI的功能。

jiaojiaodubai commented 8 months ago

在 cf0d9458ff6c0c23649a4c803c736b8e92f3f7d3 完成

doubanchan commented 8 months ago

@jiaojiaodubai

DOI格式化

https://github.com/l0o0/translators_CN/blob/cf0d9458ff6c0c23649a4c803c736b8e92f3f7d3/ChinaXiv.js#L117

改成

newItem.DOI = attr(doc, '.bd li > a[href*="dx.doi.org"]', 'href').replace(/^(http:\/\/dx.doi.org\/)/,"");

可以去掉前面的 http://dx.doi.org/

插入CSTR标识符 https://github.com/l0o0/translators_CN/blob/cf0d9458ff6c0c23649a4c803c736b8e92f3f7d3/ChinaXiv.js#L140 前增加一行 item.extra += addExtra('CSTR',text(doc, '.bd li > a[href*="cstr.cn/CSTR"]', 'href').replace(/^(CSTR:)/,"")); 可以在extra插入 CSTR标识符。

可能未注册DOITest cast中,平台提供了doi标识符值,不过该doi目前无法解析,且因为无超链接,也无法用前面的函数抓取到。您看一下。

jiaojiaodubai commented 8 months ago

DOI格式化 可以去掉前面的 http://dx.doi.org/

观察testcases发现,Zotero似乎会自己清理这个部分?就像ISSN一样。

插入CSTR标识符

我明天连同这里提到的问题一起修复一下。

可能未注册DOI

正如之前所说,我们无法对平台提供的数据负责。(我甚至遇到过doi指向某些不可描述的网站😓)