Atypon Journals
Hi guys!
I need to extend the current atypon translator so that it will also collect author affiliation when it scrape the site.
But I'm having big problem with understanding how to extend it.
I have tried to add var that I call affiliation, and used the function
doc.getElementsByClassName('listGroup') and told it that it can find this information in the <li class="listGroup"> But this doesn't work, can someone please tell me how I can do this?
I need to extend the current atypon translator so that it will also collect author affiliation when it scrape the site.
But I'm having big problem with understanding how to extend it.
I have tried to add var that I call affiliation, and used the function
doc.getElementsByClassName('listGroup') and told it that it can find this information in the <li class="listGroup"> But this doesn't work, can someone please tell me how I can do this?
var affiliation = [];
var affiliations = doc.getElementsByClassName('listGroup')
for (i=0; i<affiliations.length; i++){
affiliation.push(affiliations[i].textContent)
}
would give you the text content of every listGroup node in an affiliation array.
http://pastebin.com/4FpbcL6N
Could that just work for me?
Zotero doesn't have a field for storing author affiliations and you can't create custom fields, so you need to think about what you want to do with this in the existing Zotero data model.
The thing I wanna do is the get the author affiliation and also be able to extract it from this scan function I have made in my java-program:
http://pastebin.com/7HUhjFsW
As you can see there I'm already extracting the abstract from the JSON-array that I get back.
Is there some way I can store the affiliation in some other field in Zotero? I just really need to scrape it and add it to my database.
How come there is no field for author affiliation btw?
So if I get you right, something like this will make the affiliation come in the field item.extra instead?
var affiliations = doc.getElementsByClassName('listGroup');
item.extra = affiliation;
or I'm wrong?
var affiliations = doc.getElementsByClassName('listGroup');
for (i=0; i<affiliations.length; i++){
affiliation.push(affiliations[i].textContent)
}
item.extra = affiliation.join("; ");
The details, again, depend on how the data is actually stored on the site. Possibly using ZU.xpathText(doc, xpath) will work better. And I've written all of the above without a syntax checker, so no promises on that front.
Okay can understand that.
The server is telling me "string => ReferenceError: affiliation is not defined".
Here is my code again:
http://pastebin.com/czikWzDM
var affiliation = [];
I would like get author affiliation to my work. I think to identify the groups around world that work in the same subject. I saw your javascript but I know nothing in programming. Nothing nothing. How can I run that? And where I can put DOI...
I don't understand the question about DOIs?