Citation wikitext generator

By Shreevatsa R Last update Aug 1, 2009 — Installed 127 times. Daily Installs: 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0
Script Summary:
Generates {{citation}} wiki markup from Google Books links
Recently Updated TopicsPosts
Suggested tweaks2

this script has 1 topic, 2 posts

Review Summary
5 stars
0 reviews (0)
4 stars
1 reviews (1)
3 stars
0 reviews (0)
2 stars
0 reviews (0)
1 star
0 reviews (0)

this script has 1 review

From a Google Books link, generates wiki markup in the
{{citation|...}} format, suitable for inclusion on Wikipedia:
http://en.wikipedia.org/wiki/Template:Citation

For example, when at the URL:
http://books.google.com/books?id=_tnwmvHmVwMC&p...
you can click "Show citation" to get
{{citation | title=Asymptotic Methods in Analysis | author1=N. G. de Bruijn | edition=3, illustrated | year=1981 | publisher=Courier Dover Publications | isbn=9780486642215 | page=5 | url=http://books.google.com/books?id=_tnwmvHmVwMC&p...}
which is in the right format for Wikipedia, more or less.

Notes
=====
Suggestions for improvement are very much welcome!

Changelog:
2009-03-15 First version
2009-03-15 Remove unneeded @requires
2009-03-15 Return to using wget
2009-03-22 Take care of 'Published 1885' etc.
2009-03-22 Handle translators and multiple info divs
2009-03-22 Put year at the beginning, making it easier to sort by
2009-03-23 Change the annoying first alert() to console.log()
2009-03-23 Fix the multiple editors bug
2009-06-14 Google changed (improved!) its markup last week; script rewritten.
2009-07-04 Change include from "books.google.com" to "books.google.tld"
2009-07-11 Refrain from adding "edition=illustrated".
2009-07-19 Slightly longer "Don't know what to do with" message.
2009-07-19 Changed Firebug-specific console.log() to GM_log
2009-07-19 Add some code to clean up links first
2009-07-22 Fixed bug in clean-up code
2009-07-22 Warn on unrecognised page numbers
2009-07-31 Google changed again. Other minor code improvements.
2009-08-01 Apparently they changed the way multiple authors work too.