Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFixes and Updates - M #1200
Conversation
zuphilip
added some commits
Dec 27, 2016
adam3smith
requested changes
Dec 29, 2016
a couple of small issues. Looks good otherwise. |
} | ||
Z.debug("Somehow during automatic testing this does not work"); | ||
Z.debug("Setting the correct type therefore here manually for the test cases") | ||
return 'journalArticle'; |
This comment has been minimized.
This comment has been minimized.
adam3smith
Dec 29, 2016
Collaborator
in its current form, I believe this will return false positives for new searches
https://academic.microsoft.com/#/news/41008148?nte=5&nts=0
as well as the homepage https://academic.microsoft.com/
I'd suggest restricting thetarget to
^https?://academic\\.microsoft\\.com/#/(search|detail)
(note also the missing ^ in your version)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
zuphilip
Dec 29, 2016
Author
Collaborator
But the dynamic loading seems to be a larger problem. Because when I comment this line out (which was only there for testing) the detection on the single item pages are not working. As far as I can see all the data is delivered via JSON into the HTML template (?) which is loaded first, e.g.
Any idea how to deal with this? I tried to use Z.monitorDOMChanges
but couldn't get it working and actually I am not sure that the DOM really changes, or maybe they use some other mechanism...
This comment has been minimized.
This comment has been minimized.
adam3smith
Dec 29, 2016
Collaborator
not really. I do trial and error with monitor DOMChanges, too, so I don't think I'd be able to do any better than you.
This comment has been minimized.
This comment has been minimized.
{ | ||
"title": "Snapshot" | ||
}, | ||
{ |
This comment has been minimized.
This comment has been minimized.
adam3smith
Dec 29, 2016
Collaborator
I don't think the proliferation of attachments is good or even acceptable, even if they're just links. Could we just take the first one?
This comment has been minimized.
This comment has been minimized.
zuphilip
Dec 29, 2016
Author
Collaborator
We could save all these links in one note with some HTML, then they would still be clickable? Technically we can also just take the first one, but I don't know if the ordering is anything than arbitrarily. I don't have strong feelings about this, but maybe one of the reason to scrape info from a search engine are these different links or other additional info.
This comment has been minimized.
This comment has been minimized.
adam3smith
Dec 29, 2016
Collaborator
I think putting the links wrapped into a href= into a note makes sense (and they'd be clickable that way). I see that they're useful, but I don't think users will be pleased with 10+ links for items.
"title": "Détails des activités <i>La Dentellière</i> de Vermeer", | ||
"extra": "Visites guidées", | ||
"url": "http://www.louvre.fr/llv/activite/detail_evenement.jsp?CONTENT%3C%3Ecnt_id=10134198673390879&CURRENT_LLV_ACTIVITE%3C%3Ecnt_id=10134198673390879&FOLDER%3C%3Efolder_id=9852723696500927", | ||
"abstractNote": "Stèle : déesse Ishtar . Provenance : Tell Ahmar, antique Til Barsip. Epoque néo-assyrienne, VIIIe siècle av. J.-C. - Département des Antiquités orientales", |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
zuphilip
Dec 29, 2016
Author
Collaborator
This comes directly from the corresponding meta
tag:
<meta name="description" content="Stèle : déesse Ishtar . Provenance : Tell Ahmar, antique Til Barsip. Epoque néo-assyrienne, VIIIe siècle av. J.-C. - Département des Antiquités orientales" />
Moreover, I am not sure how exactly the correct spacing would look like here and if there is a general pattern for that... I guess we could update and improve more things in this translator, but currently I wanted to concentrate that it works again. Can we maybe postpone this and make in issue for it to look at it later?
This comment has been minimized.
This comment has been minimized.
zuphilip
reviewed
Dec 29, 2016
item.attachments.push({ | ||
title: "Snapshot", | ||
document: doc | ||
}); |
This comment has been minimized.
This comment has been minimized.
zuphilip
Dec 29, 2016
Author
Collaborator
The saved snapshots are not really useful, because they don't contain any information.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please have a look at the new version. |
This comment has been minimized.
This comment has been minimized.
It looks good, but the MS Academic translator doesn't work correctly for me on Linux (tested in Chrome and Firefox): It works fine in Scaffold and it works when _re_loading the page, but it doesn't work when first going to MS Academic. In other words, going to |
This comment has been minimized.
This comment has been minimized.
What happens if you directly start with https://academic.microsoft.com/#/detail/2084324324 and then click around the linked pages which stay on Microsoft Academic, i.e. journal, author pages, some other publications, reference, field of interests? Does this work for you as expected with the correct symbol detected? When you start at https://academic.microsoft.com then the target will exclude the translator to do anything and the |
This comment has been minimized.
This comment has been minimized.
What doesn't seem to work is going from /detail/ to /search/ e.g. when I start on |
This comment has been minimized.
This comment has been minimized.
Okay, I see. In this case the monitored DOM part is not changing but a parent node is set to invisible |
zuphilip
added some commits
Dec 31, 2016
This comment has been minimized.
This comment has been minimized.
Okay, I extensively tested and adjusted the |
adam3smith
merged commit c9a994d
into
zotero:master
Jan 7, 2017
This comment has been minimized.
This comment has been minimized.
Yes! Nicely done on the MS Academic site! |
zuphilip commentedDec 27, 2016
Some comments are also in the individual commit messages.