Skip to content

Commit 5c7bd25

Browse files
committed
new JS
1 parent a049ff6 commit 5c7bd25

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

assets/script.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ document.addEventListener("DOMContentLoaded", () => {
107107

108108
run();
109109

110+
document.querySelectorAll('.citation[data-doi]').forEach(async (el) => {
111+
const doi = el.getAttribute('data-doi');
112+
const res = await fetch(`https://odd-butterfly-821e.sirshakiba.workers.dev/?doi=${encodeURIComponent(doi)}`);
113+
const json = await res.json();
114+
const count = parseInt(json?.['abstracts-retrieval-response']?.coredata?.['citedby-count']);
115+
console.log(doi, count);
116+
});
117+
110118
const toggleText = {
111119
default: 'CONTACT',
112120
alternate: 'HOME'

0 commit comments

Comments
 (0)