-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
416 lines (361 loc) · 15 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ISBNiser</title>
<link rel="stylesheet" href="https://www.fourmilab.ch/documents/styles/standard_screen.css"
type="text/css" />
<style type="text/css">
blockquote.rights {
text-align: justify;
font-size: smaller;
font-family: sans-serif;
}
h1.title {
margin-bottom: 0px;
text-align: center;
}
div.options {
margin-left: 10%;
margin-right: 10%;
}
dl.options :first-child {
margin-top: 0px;
}
dl.options dt {
font-weight: bold;
margin-top: 1ex;
padding-bottom: 0px;
}
img.border0 {
border: 0px;
}
p,dd, li, blockquote, td {
text-align: justify;
}
p.byline {
margin-top: 0px;
text-align: center;
}
table.footer {
width: 100%;
}
table.footer td.left {
width: 50%;
text-align: left;
font-style: italic;
vertical-align: top;
}
table.footer td.right {
width: 50%;
text-align: right;
vertical-align: top;
}
table.footer table.buttons {
margin-left: auto;
}
table.footer table.buttons td {
text-align: center;
}
</style>
<meta name="keywords" content="ISBNiser, ISBN, Amazon, associates, perl, fourmilab" />
<meta name="description" content="ISBNiser" />
<meta name="author" content="John Walker" />
<meta name="robots" content="index" />
<script type="text/javascript" src="https://www.fourmilab.ch/documents/scripts/externalLinks.js">
</script>
</head>
<body class="standard" onload="externalLinks();">
<h1 class="title">ISBNiser</h1>
<p class="byline">by <a href="/">John Walker</a></p>
<p />
<hr />
<p />
<p>
International Standard Book Numbers
(<a href="https://en.wikipedia.org/wiki/International_Standard_Book_Number"
rel="Target:ISBNiser_Aux">ISBN</a>s) are unique numbers which
identify published books. Each edition of a book (for example,
hardcover, paperback, and electronic) has its own ISBN, so a bookstore
can order the book based on the ISBN and be assured of receiving
the desired edition. ISBNs are integral to the operation of on-line
book vendors and distributors of electronic editions of books.
</p>
<p>
The ISBN standard was adopted in 1970 by the International Organisation
for Standardisation (ISO) as ISO 2108. Initially, ISBNs were
10 character codes, with the first digits indicating the so-called
“registration group”, which generally identifies the language
of the publication. In 2007, ISBNs were extended to a 13-digit code
compatible with the
<a href="https://en.wikipedia.org/wiki/International_Article_Number"
rel="Target:ISBNiser_Aux">European Article Number</a> (EAN) system of product
identification, with a Unique Country Code (UCC) of 978 denoting
“Bookland”, with 979 reserved for expansion of that
address space as necessary. With the change to 13-digit codes,
the original ISBNs were redesignated ISBN-10, and the new ones
ISBN-13. Any ISBN-10 can be converted to an ISBN-13 with a UCC
of 978, and any ISBN-13 in UCC 978 can be converted to an
ISBN-10. ISBNs with a UCC of 979 cannot, however, be converted
back to ISBN-10. Most books published prior to 2019 have UCC 978,
but over the years 979 has become more common, especially in books
from newly-established small presses.
</p>
<p>
The ISBN-10 and ISBN-13 systems are very different. Both incorporate
a check digit to guard against errors in manual transcription or
machine scanning, but they use different algorithms. In ISBN-10, the
check digit can range from 0 to 10, with the last character of the
code using the letter “<tt>X</tt>” to denote a
check digit with value 10. ISBN-13 uses the EAN checksum algorithm, which
yields check digits from 0 through 9, and hence are all numeric. Both
ISBN-10 and ISBN-13 can include non-alphanumeric delimiters, which
often separate the prefix (for ISBN-13), registration group element,
registrant, publication, and checksum, for example
“<tt>978-0-471-64877-2</tt>”. These delimiters are
of no significance in interpreting the number: a specification
of “<tt>978.0.471.64877.2</tt>” or
“<tt>9780471648772</tt>” is completely
equivalent. Traditionally, the larger publishers always
delimited their registrant number to show how big they were (a two
or three digit number is prestigious), but increasingly now, you see
ISBN-13s with no delimiters: just thirteen digits. (And, since
you didn't ask, Fourmilab's ISBN-13 block is
“<tt>978-1-936047-</tt><em>xx</em><tt>-</tt><em>c</em>”—six
digits of registrant!) The structure of ISBNs permits parsing
its fields purely from the number without delimiters.
</p>
<p>
As one who reads and reviews a lot of books, I find myself
frequently working with ISBNs. My site is an Amazon.com
associate, and to pay the rent, I often need to turn ISBN-13s
I cite in reviews into ISBN-10s which can be used in Amazon
links (<em>Hello!</em> It's been <em>more than ten years</em>, Amazon.
Gonna fix that one of these days?). Enter <b>ISBNiser</b>.
</p>
<p>
<b>ISBNiser</b> is a command line utility which can be run on
any system which supports the Perl language. It accepts
arguments which can be either ISBN-13s or ISBN-10s, with or
without delimiters, checks them for validity, and displays the
ISBN in all valid forms including, if configured, an Amazon
associate link ready to go <em>ka-ching</em> into your reading
budget every time a visitor to your site clicks it.
</p>
<p>
<b>ISBNiser</b> is run from the command line. Here is a sample
query:
</p>
<pre style="font-size: smaller;">
$ isbniser.pl -cmyassocacct \
0-309-09657-X 0.309.09657.X 1844135438 \
9780385611015 978-0-471-64877-2 978.0.471.64877.2 \
979-12-200-0852-5 1844135437
ISBN-10: 0-309-09657-X 030909657X ISBN-13: 9780309096577 978-0-309-09657-7
http://www.amazon.com/dp/030909657X/?tag=myassocacct
ISBN-10: 0.309.09657.X 030909657X ISBN-13: 9780309096577 978.0.309.09657.7
http://www.amazon.com/dp/030909657X/?tag=myassocacct
ISBN-10: 1-84413-543-8 1844135438 ISBN-13: 9781844135431 978-1-84413-543-1
http://www.amazon.com/dp/1844135438/?tag=myassocacct
ISBN-13: 978-0-385-61101-5 9780385611015 ISBN-10: 0385611013 0-385-61101-3
http://www.amazon.com/dp/0385611013/?tag=myassocacct
ISBN-13: 978-0-471-64877-2 9780471648772 ISBN-10: 0471648779 0-471-64877-9
http://www.amazon.com/dp/0471648779/?tag=myassocacct
ISBN-13: 978.0.471.64877.2 9780471648772 ISBN-10: 0471648779 0.471.64877.9
http://www.amazon.com/dp/0471648779/?tag=myassocacct
ISBN-13: 979-12-200-0852-5 9791220008525 ISBN-10: Unmappable
Invalid ISBN: 1844135437
</pre>
<p>
As in this example, you can specify multiple ISBNs in any of the
accepted formats on the command line. If an ISBN-13 has a prefix of
“<tt>979</tt>”, it cannot be represented as an ISBN-10
and will be shown as “Unmappable”. Invalid ISBNs (those
which have an invalid check digit, are too long or short, or contain
invalid characters) will be reported.
</p>
<p>
By default, non-alphanumeric delimiters in the ISBNs specified are
discarded and the same delimiter re-inserted in the ISBN-10 and
ISBN-13 displayed at the positions determined by parsing the number.
If the ISBN is invalid or in a format not defined by the standard,
it will be displayed without delimiters. The <tt>−p</tt>
option preserves the original delimiters in the specified ISBN.
</p>
<p>
You can control the operation of <b>ISBNiser</b> by specifying the
following options on the command line.
</p>
<div class="options">
<dl class="options">
<dt><tt>−a</tt><em>URL</em></dt>
<dd>The specified URL will be used in Amazon associate
links. Specify the Amazon site to which you wish the link
directed, such as <tt>www.amazon.com</tt>,
<tt>www.amazon.co.uk</tt>, <tt>www.amazon.co.jp</tt>, etc.
The default Amazon URL is set by the
<tt>$Amazon</tt> variable in the program.</dd>
<dt><tt>−c</tt><em>account</em></dt>
<dd>Amazon associate links will credit <em>account</em>
for purchases made through them. The default is set
by the <tt>$credit</tt> variable in the program.
If the null string is specified, no associate account
will be credited.</dd>
<dt><tt>−d</tt></dt>
<dd>Output will be in machine-readable “database”
(CSV: Comma-Separated Value) format, one line per ISBN
argument. See the “CSV Format Output”
section below for details.</dd>
<dt><tt>−g</tt></dt>
<dd>Print the name of the ISBN registration group from
the prefix.</dd>
<dt><tt>−n</tt></dt>
<dd>Do not verify subsequent specifications on the command
line. This allows generating Amazon associate links for
<a href="https://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number"
rel="Target:ISBNiser_Aux">ASIN</a>s
which do not verify as ISBNs.</dd>
<dt><tt>−p</tt></dt>
<dd>Preserve the original delimiters in the specified ISBN.
Otherwise, delimiters are re-generated automatically by
parsing the number.</dd>
<dt><tt>−r</tt></dt>
<dd>Use the alternative Amazon associate account configured
as <tt>$creditR</tt> within the program. You can credit
to any account you wish with the <tt>−c</tt>
option; this is simply a convenience when you frequently
credit to a main and alternative account.</dd>
<dt><tt>−u</tt> <tt>−−help</tt></dt>
<dd>Print how-to-call information. This information is also
printed if the program is called with no arguments.</dd>
<dt><tt>−v</tt></dt>
<dd>Verify subsequent specifications on the command
line. This reverses the effect of a previous
<tt>−n</tt> option.</dd>
</dl>
</div>
<h2>Downloading and Installation</h2>
<p>
<b>ISBNiser</b> may be downloaded from the following link:
</p>
<blockquote>
<p>
<b><tt><a href="download/isbniser-1.7.tar.gz">isbniser-1.7.tar.gz</a></tt></b>:
Gzipped TAR archive (49 Kb)
</p>
</blockquote>
<p>
Included in the archive are the Perl program
<b><tt>isbniser</tt></b> as well as
this document. You can run the Perl program from directory
into which you extracted it or install it in a system
library directory to make it accessible to all users.
The <b><tt>isbniser</tt></b> program is monolithic and
requires no other files to run; it may be
installed anywhere. It is created automatically from its
component files under control of the <b><tt>Makefile</tt></b>.
</p>
<p>
This program requires no Perl modules; it will work on a base
installation of Perl.
</p>
<h2>CSV Format Output</h2>
<p>
When the <tt>−d</tt> option is specified, output from
<b>ISBNiser</b> consists of one line per ISBN argument on the
command line in Comma-Separated Value (CSV) format. The
fields are as follows. Fields which may contain non-alphanumeric
characters are always enclosed in double quotes.
</p>
<ol>
<li>Status: numeric status
<ul>
<li><b>200</b> Normal, ISBN-13 and ISBN-10 returned</li>
<li><b>201</b> Normal, ISBN-13 returned, 979- unmappable
to ISBN-10</li>
<li><b>300</b> Invalid registration group, unhyphenated
ISBN-13 and ISBN-10 returned</li>
<li><b>301</b> Invalid registration group, unhyphenated
979- ISBN-13 returned</li>
<li><b>401</b> Incorrect length (not 10 or 13 characters)</li>
<li><b>402</b> Illegal character</li>
<li><b>403</b> “<tt>X</tt>” as other than last
character of ISBN-10</li>
<li><b>404</b> Checksum incorrect</li>
<li><b>405</b> ISBN-13 prefix is not Bookland (978 or 979)</li>
</ul>
</li>
<li>ISBN-13, no delimiters</li>
<li>ISBN-13, with delimiters (quoted)</li>
<li>ISBN-10, no delimiters (“<tt>Unmappable</tt>”
if 979- prefix)</li>
<li>ISBN-10, with delimiters (“<tt>Unmappable</tt>”
if 979- prefix) (quoted)</li>
<li>Registration group name (quoted)</li>
<li>Amazon associates URL (quoted)</li>
<li>ISBN Registration group database date (quoted)</li>
</ol>
<p />
<hr />
<p />
<blockquote class="rights">
<p>
This product (software, documents, and data files) is licensed under a
Creative Commons
<a href="https://creativecommons.org/licenses/by-sa/4.0/"
rel="Target:ISBNiser_Aux">Attribution-ShareAlike 4.0 International
License</a>
(<a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode"
rel="Target:ISBNiser_Aux">legal text</a>).
You are free to copy and redistribute this material in any medium or
format, and to remix, transform, and build upon the material for any
purpose, including commercially. You must give credit, provide a link
to the license, and indicate if changes were made. If you remix,
transform, or build upon this material, you must distribute your
contributions under the same license as the original.
</p>
<p>
This product is provided with no warranty, either expressed or implied,
including but not limited to any implied warranties of merchantability
or fitness for a particular purpose, regarding these materials and is
made available available solely on an “as-is” basis.
</p>
</blockquote>
<table class="footer">
<tr>
<td class="left">
by <a href="/">John Walker</a><br />
October, 2021
</td>
<td class="right">
<table class="buttons">
<tr><td>
<form id="feedback" method="post" action="/cgi-bin/FeedbackForm.pl">
<div>
<input type="hidden" name="pagetitle" value="ISBNiser" />
<input type="hidden" name="backlink" value="Back to <cite>ISBNiser</cite>" />
<input type="submit" value=" Send Feedback " />
</div>
</form>
</td></tr>
<tr><td>
<a href="http://validator.w3.org/check?uri=http://www.fourmilab.ch/webtools/isbniser/index.html"
rel="Target:Fourmilab_Validation" class="i"><img
src="/images/icons/valid-xhtml10.png"
class="border0"
alt="Valid XHTML 1.0" height="31" width="88" /></a>
<a href="https://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.fourmilab.ch%2Fwebtools%2Fisbniser%2Findex.html&profile=css3svg&usermedium=all&warning=1&vextwarning=&lang=en"
rel="Target:Fourmilab_Validation" class="i"><img
src="/images/icons/vcss.png"
class="border0"
alt="Valid CSS" height="31" width="88" /></a>
</td></tr>
</table>
</td>
</tr>
</table>
<h3><a href="/">Fourmilab Home Page</a></h3>
</body>
</html>