Suggested improvement to COinS importer
Within a COinS span, there may be an anchor (<a>) that links to the URL of the article referenced. See for example the reference at the end of this blog post:
http://xcorr.net/2013/01/24/categories/
It's straightforward to:
Sample implementation (only attaches last URL within the span):
in doWeb:
in completeItems, in the else clause:
http://xcorr.net/2013/01/24/categories/
It's straightforward to:
- read the hrefs of these anchors
- add them in the URL field of the added item and
- add snapshots of the URLs in question to the added item
Sample implementation (only attaches last URL within the span):
in doWeb:
var theas = doc.evaluate('.//a[@href]', span, nsResolver, XPathResult.ANY_TYPE, null);
while(thea = theas.iterateNext())
{
newItem.URL = thea.href;
}
in completeItems, in the else clause:
if(newItems[i].URL)
{
newItems[i].attachments.push({title:'[Original article] ' + newItems[i].title,url:newItems[i].URL,mimeType:'text/html'});
}
http://ocoins.info/#id3205609416
DOI sounds like a good idea to me - any objections? (one possible problem could be that the COinS - assuming it is for the actual article the user is looking at - could be from a non-gated version of an article and the DOI could resolve to a gated one, not sure how likely that is).