User talk:Dr pda/persondata.js

This script is designed to simplify the addition of persondata to biographical articles.

What is Persondata?
Persondata is special metadata which can be added to biographical articles. This metadata can then be extracted and processed automatically. On the German Wikipedia 95% of biographies (approx 120 000 articles) are tagged with persondata. One example of its use is this page which allows you to find all people who were born/died on a given date (and have articles in the de wiki).

The persondata template has the fields:

How the script works
All the persondata information (if known) should already be contained in the article. While it is trivial for a person to scan the article and extract this information, it is difficult to do automatically, as the information is generally not in a standardised format. However many biographies already contain an infobox, the fields of which are easily parsed, and contain most or all of the information required by the persondata template. The script therefore extracts as much information as it can, inserts the persondata template into the article, and shows the diff, so you can see what was added, and (if it is OK) save it. The script has been tested with the 20 or so most common infoboxes. These are (as of February 2007): This is a total of approx 50000 articles. Currently more than 950, 000 articles contain the persondata template.
 * 1) Infobox Football biography 9938
 * 2) Infobox musical artist 9281
 * 3) Infobox NFL player 4203
 * 4) Infobox actor 3821
 * 5) Infobox Biography 2814
 * 6) Infobox Military Person 2080
 * 7) Infobox musical artist 2 2072
 * 8) Infobox Officeholder 2031
 * 9) Infobox Ice Hockey Player 1681
 * 10) Infobox celebrity 1428
 * 11) Infobox MLB player 1174
 * 12) Infobox Wrestler 1155
 * 13) Infobox President 1028
 * 14) Infobox writer 991
 * 15) Infobox afl player 870
 * 16) Infobox Politician 804
 * 17) Infobox Congressman 722
 * 18) Infobox NBA player 657
 * 19) Infobox Prime Minister 648
 * 20) Infobox Scientist 645

Other infoboxes will probably also work if they use similar names for the parameters.

How to use the script
To get the script working add  (or your favourite method of importing a script) to your personal userscript page, then do a forced reload to bypass the cache (ctrl+shift+R in Firefox, ctrl+F5 in Internet Explorer, F5 in Opera, etc).

In normal mode if an article already has persondata you will see a tab show/hide persondata. Clicking on this toggles the display of persondata, located at the bottom of the article. This tab also serves to indicate at a glance whether an article has persondata.

In edit mode if an article doesn't have persondata, a tab add persondata will appear. (NB this will happen even for non-biographical articles!). If you click on this tab the script will extract as much data as it can from the first infobox it finds. (If there is no infobox the script will not do anything), and then automatically click the Show changes button, so you can see the results. Check the persondata template, make any necessary changes, and then save the article.

Advice

 * ALWAYS CHECK THE OUTPUT BEFORE SAVING
 * In particular check the NAME and ALTERNATIVE NAMES fields; sometimes middle names are omitted, unnecessary honorifics are included, the name and alternative name should be swapped, etc.
 * Not all infoboxes contain all the fields for persondata, you may need to add some manually.
 * Check the persondata page for further information on how to fill in the fields (note that name should be lastname, firstname).
 * Moreover, take care when using it on people without last names, like Peter II of Russia. He should not be listed as "II, Peter", but instead "Peter II, Emperor of Russia". See Persondata for further clarification.

Conflict with WikEd
Just a minor problem, I have to disable WikEd before this script will work, but then it does what it says it does with no problem. – ukexpat (talk) 21:42, 7 April 2008 (UTC)
 * Seems to be working fine with wikEd and Firefox 3.0.11 at this time. Chuckiesdad/Talk/Contribs 17:17, 15 July 2009 (UTC) Oops, the 'show/hide' script works fine, but you still have to disable wikEd to make the 'add data' script work. Chuckiesdad/Talk/Contribs 17:50, 15 July 2009 (UTC)

Bug/Glitch
I just tried to use the script on Unity Mitford and the output was a mess. I am sure it is caused by some of the formatting/text of the article, so just reporting it as an FYI. – ukexpat (talk) 13:50, 29 May 2008 (UTC)

FYI: AWB and persondata
As an FYI I am working on logic to add to the general fixes of AutoWikiBrowser to automatically insert or complete persondata too. Rjwilmsi 10:58, 24 August 2010 (UTC)

Won't work
I tried it on Dragoljub Bekvalac and the script did nothing.-- Yutsi Talk/  Contributions  16:26, 7 January 2011 (UTC)

Vector skin
Is the Vector skin supported? -happy5214 07:38, 20 June 2011 (UTC)
 * I can confirm that it does work with the Vector skin. —Quibik (talk) 12:03, 17 September 2011 (UTC)