9
9
"inRepository" : true ,
10
10
"translatorType" : 4 ,
11
11
"browserSupport" : "gcsibv" ,
12
- "lastUpdated" : "2012-12-19 01:24:23 "
12
+ "lastUpdated" : "2013-02-25 21:26:18 "
13
13
}
14
14
15
15
/*
@@ -98,19 +98,19 @@ function doWeb(doc, url) {
98
98
99
99
function processor ( obj ) {
100
100
// Gets {translator: , text: }
101
+ //Z.debug(obj.text)
101
102
// Here, we split up the table and insert little placeholders between record bits
102
103
var marced = obj . text . replace ( / \s + / g, " " )
103
104
. replace ( / ^ .* < d i v i d = " m a r c _ d e t a i l s " > (?: \s * < [ ^ > " ] + > \s * ) * / , "" )
104
105
. replace ( / < t r + c l a s s = " (?: o d d | e v e n ) " > \s * / g, "" )
105
- . replace ( / < t d + c l a s s = " m a r c T a g " > < s t r o n g > ( \d + ) < \/ s t r o n g > < \/ t d > \s * / g, "$1\x1F" )
106
+ . replace ( / < t d + s c o p e = " r o w " + c l a s s = " m a r c T a g " > < s t r o n g > ( \d + ) < \/ s t r o n g > < \/ t d > \s * / g, "$1\x1F" )
106
107
// We may be breaking the indicator here
107
108
. replace ( / < t d \s + c l a s s = " m a r c I n d i c a t o r " > \s * ( \d * ) \s * < \/ t d > \s * / g, "$1\x1F" )
108
109
. replace ( / < t d + c l a s s = " m a r c T a g D a t a " > ( .* ?) < \/ t d > \s * < \/ t r > \s * / g, "$1\x1E" )
109
110
. replace ( / \x1F (?: [ ^ \x1F ] * ) $ / , "\x1F" )
110
111
// We have some extra 0's at the start of the leader
111
112
. replace ( / ^ 0 0 0 / , "" ) ;
112
113
//Z.debug(marced);
113
-
114
114
// We've used the record delimiter to delimit fields
115
115
var fields = marced . split ( "\x1E" ) ;
116
116
@@ -122,15 +122,18 @@ function processor (obj) {
122
122
// The first piece is the MARC leader
123
123
record . leader = fields . shift ( ) ;
124
124
for each ( var field in fields ) {
125
+ //Z.debug(field)
125
126
// Skip blanks
126
127
if ( field . replace ( / \x1F | \s / g, "" ) == "" ) continue ;
127
128
// We're using the subfield delimiter to separate the field code,
128
129
// indicator, and the content.
129
130
var pieces = field . split ( "\x1F" ) ;
131
+ if ( pieces . length > 2 ) {
130
132
record . addField ( pieces [ 0 ] . trim ( ) ,
131
133
pieces [ 1 ] . trim ( ) ,
132
134
// Now we insert the subfield delimiter
133
135
pieces [ 2 ] . replace ( / \$ ( [ a - z ] | $ ) / g, "\x1F$1" ) . trim ( ) ) ;
136
+ }
134
137
}
135
138
// returns {translator: , text: false, items: [Zotero.Item[]]}
136
139
var item = new Zotero . Item ( ) ;
@@ -144,73 +147,84 @@ function processor (obj) {
144
147
var testCases = [
145
148
{
146
149
"type" : "web" ,
147
- "url" : "http://bostonpl.bibliocommons.com/item/catalogue_info/2993906042_test " ,
150
+ "url" : "http://bostonpl.bibliocommons.com/item/show/2051015075_labor " ,
148
151
"items" : [
149
152
{
150
153
"itemType" : "book" ,
151
154
"creators" : [
152
155
{
153
- "firstName" : "William " ,
154
- "lastName" : "Sleator " ,
156
+ "firstName" : "Marcia McKenna " ,
157
+ "lastName" : "Biddle " ,
155
158
"creatorType" : "author"
156
159
}
157
160
] ,
158
161
"notes" : [
159
162
{
160
- "note" : "In the security-obsessed, elitist United States of the near future, where a standardized test determines each person's entire life, a powerful man runs a corrupt empire until seventeen-year-old Ann and other students take the lead in boycotting the test "
163
+ "note" : "Brief biographies of five women prominently involved in the labor movement in the United States: Mother Jones, Mary Heaton Vorse, Frances Perkins, Addie Wyatt, and Dolores Huerta. Also includes 11 other women who have made outstanding contributions "
161
164
}
162
165
] ,
163
166
"tags" : [
164
- "Educational tests and measurements" ,
165
- "Education" ,
166
- "Political corruption" ,
167
- "Immigrants" ,
168
- "Conspiracies"
167
+ "Women labor union members" ,
168
+ "United States" ,
169
+ "Women" ,
170
+ "United States" ,
171
+ "Women labor union members" ,
172
+ "Working class"
169
173
] ,
170
174
"seeAlso" : [ ] ,
171
175
"attachments" : [ ] ,
172
- "ISBN" : "9780810993563" ,
173
- "title" : "Test" ,
174
- "place" : "New York" ,
175
- "publisher" : "Amulet Books" ,
176
- "date" : "2008" ,
177
- "numPages" : "298" ,
178
- "callNumber" : "SLEATOR W" ,
176
+ "ISBN" : "0875181678" ,
177
+ "title" : "Labor" ,
178
+ "place" : "Minneapolis" ,
179
+ "publisher" : "Dillon Press" ,
180
+ "date" : "1979" ,
181
+ "numPages" : "126" ,
182
+ "series" : "Contributions of women" ,
183
+ "callNumber" : "HD6079.2.U5 B52" ,
179
184
"libraryCatalog" : "bostonpl Library Catalog"
180
185
}
181
186
]
182
187
} ,
183
188
{
184
189
"type" : "web" ,
185
- "url" : "http://bostonpl.bibliocommons.com/item/show/3679347042_adam_smith" ,
190
+ "url" : "http://bostonpl.bibliocommons.com/search?t=smart&search_category=keyword&q=labor&commit=Search" ,
191
+ "items" : "multiple"
192
+ } ,
193
+ {
194
+ "type" : "web" ,
195
+ "url" : "http://nypl.bibliocommons.com/item/show/10974089052_labour" ,
186
196
"items" : [
187
197
{
188
198
"itemType" : "book" ,
189
199
"creators" : [
190
200
{
191
- "firstName" : "James R." ,
192
- "lastName" : "Otteson" ,
201
+ "firstName" : "György" ,
202
+ "lastName" : "Lukács" ,
203
+ "creatorType" : "author"
204
+ } ,
205
+ {
206
+ "firstName" : "György" ,
207
+ "lastName" : "Lukács" ,
193
208
"creatorType" : "author"
194
209
}
195
210
] ,
196
211
"notes" : [ ] ,
197
212
"tags" : [
198
- "Smith, Adam " ,
199
- "Free enterprise " ,
200
- "Classical school of economics "
213
+ "Labor " ,
214
+ "Philosophy " ,
215
+ "Philosophy, Marxist "
201
216
] ,
202
217
"seeAlso" : [ ] ,
203
218
"attachments" : [ ] ,
204
- "ISBN" : "0826429831" ,
205
- "title" : "Adam Smith" ,
206
- "place" : "New York" ,
207
- "publisher" : "Continuum" ,
208
- "date" : "2011" ,
209
- "numPages" : "179" ,
210
- "series" : "Major conservative and libertarian thinkers" ,
211
- "seriesNumber" : "v. 16" ,
212
- "callNumber" : "HB103.S6 O88 2011" ,
213
- "libraryCatalog" : "bostonpl Library Catalog"
219
+ "title" : "Labour" ,
220
+ "place" : "London" ,
221
+ "publisher" : "Merlin Press" ,
222
+ "date" : "1980" ,
223
+ "numPages" : "139" ,
224
+ "series" : "The Ontology of social being" ,
225
+ "seriesNumber" : "3" ,
226
+ "callNumber" : "JFD 87-5272" ,
227
+ "libraryCatalog" : "nypl Library Catalog"
214
228
}
215
229
]
216
230
}
0 commit comments