Wikipedia talk:WikiProject User scripts/Scripts/Set Book Source

Code update
editprotected The script has been modified to make it easier to change the redirect URL. Please see User:Lunchboxhero/monobook.js. Would an admin please update this page.

Lunchboxhero (talk)19:23, 29 December 2007 (UTC)


 * The code looks quite different - what is the point of the MAGICNUMBER stuff? Also, what change is being requested here - please be specific about what you would like to be changed here. &mdash; Carl (CBM · talk) 18:15, 30 December 2007 (UTC)

The code on this page is an earlier version of the script at User:Lunchboxhero/monobook.js. The point of both scripts are to rewrite ISBN links to point to the book source of the users choice, instead of the Special:Book_sources page, which has grown so large as to become nearly useless. The main difference between the version at User:Lunchboxhero/monobook.js and the older version on this page is that the current version has been modified to make it easier for the user to replace the book source url. Particularly, the later version pulls the book source url out of the loop and defines it separately as a variable. MAGICNUMBER is to make it very easy for users to cut and paste the book source urls from Wikipedia:Book_sources into this script as a the MagicURL. MAGICNUMBER is a reserved word in the Mediawiki software and is dynamically replaced with the ISBN number by the software when the Special:Book_sources is visited. All the urls for book sources on Wikipedia:Book_sources have MAGICNUMBER in them.

What I am asking is that this earlier version of the script be replaced by the updated one that can be found at User:Lunchboxhero/monobook.js.

21:18, 30 December 2007 (UTC)


 * ✅ Tra (Talk) 14:23, 1 January 2008 (UTC)

Amazon associate

 * I was more concerned about the "wikipedia08-20" part- is this sending money somewhere? &mdash; Carl (CBM · talk) 15:45, 1 January 2008 (UTC)


 * I haven't used this script myself but I would presume that books purchased through this script would cause Amazon to give a commission to the wikipedia08-20 account. I think it's OK, the person installing the script is told clearly what it does and how to disable it. Tra (Talk) 15:55, 1 January 2008 (UTC)


 * Is there a way I can verify that wikipedia08-20 actually belongs to wikipedia? I'm just being diligent here. &mdash; Carl (CBM · talk) 16:01, 1 January 2008 (UTC)


 * I've had a look, and here is where it's mentioned throughout Wikipedia. I didn't find anything solidly confirming its authenticity but if you follow that link and tick the user namespace, you'll also see that it's used in quite a lot of monobooks, so if it is a hoax, a lot of people have been taken in by it. Tra (Talk) 16:18, 1 January 2008 (UTC)
 * Here's Jimmy Wales original email from January 2004 mentioning it. (See also January archives for the rest of the amazon thread(s)). -- Quiddity (talk) 20:18, 4 May 2010 (UTC)
 * The associate number seems to have been removed from Book sources itself way back in June 2004. I've asked some followup questions at Wikipedia talk:Book sources - please comment there, if you have further information or questions. Thanks. -- Quiddity (talk) 20:13, 6 May 2010 (UTC)

2 problems
I've recently encountered 2 specific problems, at least when using amazon. Hopefully someone knows how to adapt the script to cope with these situations. Thanks. -- Quiddity (talk) 20:02, 4 May 2010 (UTC)
 * Dashes break links, and need to be stripped: ISBN 0-9525-4570-5 vs ISBN 0952545705
 * When the cite book template includes additional context for the ISBN field, such as "pbk" (as used at Andy Goldsworthy), the links break. E.g.

There's a newer version of the script which can be found at User:Lunchboxhero/monobook.js, that should fix both of your problems.

Lunchboxhero (talk) 02:27, 6 May 2010 (UTC)
 * Much thanks. :) -- Quiddity (talk) 18:06, 6 May 2010 (UTC)