Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update Microsoft Academic #2107

wants to merge 3 commits into from

Conversation

zuphilip
Copy link
Contributor

@zuphilip zuphilip commented Jan 5, 2020

case 0:
type = "book";
break;
// TODO what is case 2? find an example for it
Copy link
Collaborator

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)

}
],
"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/>"
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@adam3smith
Copy link
Collaborator

I only have one question -- looks great otherwise.

@zuphilip
Copy link
Contributor Author

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.

@zhengyu-yang
Copy link

zhengyu-yang commented Jan 23, 2020

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');

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);
*/

Copy link

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
	});	
}

@adam3smith
Copy link
Collaborator

@zuphilip do you want to take another look based on @elony314 's comments? Should be quick I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants