New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Microsoft Academic #2107
base: master
Are you sure you want to change the base?
Conversation
Microsoft Academic.js
Outdated
case 0: | ||
type = "book"; | ||
break; | ||
// TODO what is case 2? find an example for it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to look a bit and looked at examples for patents, book chapters, others, and repository papers, none of which was 2 (they were either 0 or 3)
Microsoft Academic.js
Outdated
} | ||
], | ||
"notes": [ | ||
{ | ||
"note": "<p>Data sources found by Microsoft Academic search engine:</p><a href=\"https://graphics.stanford.edu/courses/cs468-03-fall/Papers/cohen_normalcycle.pdf\">https://graphics.stanford.edu/courses/cs468-03-fall/Papers/cohen_normalcycle.pdf</a><br/><a href=\"https://dpt-info.u-strasbg.fr/~sauvage/Recherche/GT_geom_diff/CM03.pdf\">https://dpt-info.u-strasbg.fr/~sauvage/Recherche/GT_geom_diff/CM03.pdf</a><br/><a href=\"http://dblp.uni-trier.de/db/conf/compgeom/compgeom2003.html#Cohen-SteinerM03\">http://dblp.uni-trier.de/db/conf/compgeom/compgeom2003.html#Cohen-SteinerM03</a><br/><a href=\"http://dl.acm.org/citation.cfm?doid=777792.777839\">http://dl.acm.org/citation.cfm?doid=777792.777839</a><br/><a href=\"http://doi.acm.org/10.1145/777792.777839\">http://doi.acm.org/10.1145/777792.777839</a><br/><a href=\"http://portal.acm.org/citation.cfm?doid=777792.777839\">http://portal.acm.org/citation.cfm?doid=777792.777839</a><br/>" | ||
"note": "<p>Data sources found by Microsoft Academic search engine:</p><a href=\"http://math.univ-lyon1.fr/~morvan/SCANPUBLICATIONS/cohensteinermorvansocg2003.pdf\">http://math.univ-lyon1.fr/~morvan/SCANPUBLICATIONS/cohensteinermorvansocg2003.pdf</a><br/><a href=\"http://www.cs.jhu.edu/~misha/Fall09/Steiner03.pdf\">http://www.cs.jhu.edu/~misha/Fall09/Steiner03.pdf</a><br/><a href=\"https://graphics.stanford.edu/courses/cs468-03-fall/Papers/cohen_normalcycle.pdf\">https://graphics.stanford.edu/courses/cs468-03-fall/Papers/cohen_normalcycle.pdf</a><br/><a href=\"http://portal.acm.org/citation.cfm?doid=777792.777839\">http://portal.acm.org/citation.cfm?doid=777792.777839</a><br/><a href=\"https://core.ac.uk/display/22880751\">https://core.ac.uk/display/22880751</a><br/><a href=\"https://dl.acm.org/citation.cfm?doid=777792.777839\">https://dl.acm.org/citation.cfm?doid=777792.777839</a><br/><a href=\"https://doi.acm.org/10.1145/777792.777839\">https://doi.acm.org/10.1145/777792.777839</a><br/>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we want to keep the notes? I could see us trying to grab a PDF attachment from this information, but as a note added to every item this doesn't seem great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But which URL you would try for grabbing the PDF from? We certainly don't want to add a PDF from all the URLs. The one with the DOI looks best, but maybe the user does not have access to the pay-walled paper. Anyway, there is the unpaywall integration in Zotero which is doing that job nowadays for publications with a DOI.
I would be okay to drop this note therefore. Also I think that one of the main advantages of Microsoft Academic (or Google Scholar) is, that it tries to find a freely available version of the paper.
I only have one question -- looks great otherwise. |
Please have a look at the new version. I suggest to leave the changes this in the 3 commits, as it makes it easier to see what changed. |
It seems it doesn't work on this page |
Zotero.monitorDOMChanges(doc.querySelector('.main')); | ||
|
||
if (url.includes('/paper/')) { | ||
var type = attr('ma-entity-detail-info i.icon-paper', 'title'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add the selector for primary_paper
icon to fix the problem I mentioned.
var type = attr('ma-entity-detail-info i.icon-paper, ma-entity-detail-info i.icon-primary_paper', 'title');
delete data.citations; | ||
Z.debug(data); | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also add the functionality to download pdf if the link is available.
// add pdf
let pdfurl_nodes = document.evaluate("//div[@class='listTitle au-target' and text()='View PDF:']/following-sibling::a[@class='ma-link-collection-item au-target']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (const i of Array(pdfurl_nodes.snapshotLength).keys()){
item.attachments.push({
title: pdfurl_nodes.snapshotItem(i).textContent.trim().replace(/,$/g, ""),
mimeType:"application/pdf",
url:pdfurl_nodes.snapshotItem(i).href
});
}
This solves the issue reported in
https://forums.zotero.org/discussion/80716/import-tags-automatically-from-microsoft-academic