Permalink
Browse files

fixes Worldcat for institutional and single-name authors

  • Loading branch information...
1 parent c54d114 commit 00ad711f817e810e9c2de4ece3be6d18788eb287 @adam3smith adam3smith committed Apr 3, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 Open WorldCat.js
View
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 12,
"browserSupport": "gcsb",
- "lastUpdated": "2012-03-12 01:16:53"
+ "lastUpdated": "2012-04-03 11:17:10"
}
/**
@@ -57,7 +57,13 @@ function scrape(doc, url, callDoneWhenFinished) {
item.extra = "";
//creators have period after firstName
for (i in item.creators) {
+ if (item.creators[i].firstName){
item.creators[i].firstName = item.creators[i].firstName.replace(/\.$/, "");
+ }
+ else {
+ item.creators[i].lastName = item.creators[i].lastName.replace(/\.$/, "");
+ item.creators[i].fieldMode=1;
+ }
}
if (language) item.language = language;
//We want ebooks to be treated like books, not webpages (is ISBN the best choice here?)

0 comments on commit 00ad711

Please sign in to comment.