User:Mithbot/Scripts
From Tolkien Gateway
Changing Internal Links[edit | edit source]
using System; using DotNetWikiBot; class MyBot : Bot { public static void Main() { Site site = new Site("http://tolkiengateway.net", "Mithbot", "PASSWORD"); PageList p = new PageList(site); p.FillFromLinksToPage("Bilbo"); p.LoadEx(); foreach (Page i in p) i.text = i.text.Replace("[[Bilbo]]", "[[Bilbo Baggins]]"); p.SaveSmoothly(1, "Bot Message: changing link to [[Bilbo Baggins]]", true); } }
To avoid certain namespaces, add this before p.LoadEx();
, User and Template in this example:-
p.RemoveNamespaces(new int[] {2,10});
The above code is used to change links to a particular page in order to remove redirects. By changing "Bilbo" and "Bilbo Baggins" this script can be re-used again and again to edit internal links. So far, it has been used for changing:
- Bilbo to Bilbo Baggins (14 June 2010);
- Siriondil of Gondor to Siriondil (King of Gondor) (14 June 2010);
- Calmacil of Gondor to Calmacil (King of Gondor) (14 June 2010);
- Cemendur of Gondor to Cemendur (King of Gondor) (14 June 2010);
- Eärendil of Gondor to Eärendil (King of Gondor) (14 June 2010);
- Anardil of Gondor to Anardil (King of Gondor) (14 June 2010);
- Turambar of Gondor to Turambar (King of Gondor) (14 June 2010);
- Eldacar of Gondor to Eldacar (King of Gondor) (14 June 2010);
- Tarondor of Gondor to Tarondor (King of Gondor) (14 June 2010);
- Calimehtar, King of Gondor to Calimehtar (King of Gondor) (14 June 2010);
- Amandil of Andúnië to Amandil (Lord of Andúnië)[former link] (14 June 2010);
- Anárion son of Elendil to Anárion (14 June 2010);
- Changing "||" to "|" - fixing own mistake (15 June 2010);
- Eärendur, Lord of Andúnië to Eärendur (Lord of Andúnië) (15 June 2010);
- Valandil of Númenor to Valandil (Lord of Andúnië) (15 June 2010);
- Silmarien to Silmariën (15 June 2010);
- Ardamir son of Axantur to Ardamir (son of Axantur) (15 June 2010);
- Eärendur, son of Tar-Amandil to Eärendur (son of Tar-Amandil) (15 June 2010);
- Cemendur of Númenor to Cemendur (son of Axantur) (15 June 2010);
- Aulendil of Númenor to Aulendil (son of Vardamir) (15 June 2010);
- Eärendur, King of Arnor to Eärendur (King of Arnor) (15 June 2010);
- Elendur, son of Isildur to Elendur (son of Isildur) (15 June 2010);
- Elendur, King of Arnor to Elendur (King of Arnor) (15 June 2010);
- Tarondor of Arnor to Tarondor (King of Arnor) (15 June 2010);
- Valandil of Arnor to Valandil (King of Arnor) (15 June 2010);
- Eldacar of Arnor to Eldacar (King of Arnor) (15 June 2010);
- Beleg of Arthedain to Beleg (King of Arthedain) (15 June 2010);
- Faramir son of Ondoher to Faramir (son of Ondoher) (15 June 2010);
- Beregond, Steward of Gondor to Beregond (Steward of Gondor)[former link] (15 June 2010);
- Boromir I and Boromir son of Denethor I to Boromir (Steward of Gondor) (15 June 2010);
- Dior of Gondor to Dior (Steward of Gondor) (15 June 2010);
- Steward Cirion to Cirion (15 June 2010);
- Barahir son of Hador to Barahir (Steward of Gondor) (15 June 2010);
- Hador of Gondor to Hador (Steward of Gondor) (15 June 2010);
- Egalmoth, Steward of Gondor to Egalmoth (Steward of Gondor) (15 June 2010);
- Faramir son of Denethor II, Faramir, son of Denethor II and Faramir (son of Denethor II) to Faramir (15 June 2010);
- Mardil to Mardil Voronwë (15 June 2010);
- Orodreth of Gondor to Orodreth (Steward of Gondor) (15 June 2010);
- Turgon of Gondor to Turgon (Steward of Gondor) (15 June 2010);
- Baranor of Gondor to Baranor (Man of Gondor)[former link] (15 June 2010);
- Beregond, soldier of Gondor to Beregond (soldier of Gondor)[former link] (15 June 2010);
- Barahir grandson of Faramir to Barahir (grandson of Faramir) (15 June 2010);
- Boromir son of Denethor II, Boromir II, Boromir, son of Denethor II Boromir (son of Denethor II) to Boromir (15 June 2010);
- Míriel of Númenor to Tar-Míriel (15 June 2010);
- Veantur to Vëantur (15 June 2010);
- Ar-Gimilzor and Gimilzôr to Ar-Gimilzôr (15 June 2010);
- Herunúmen to Tar-Herunúmen (15 June 2010);
- Beruthiel and Queen Berúthiel to Berúthiel (15 June 2010);
- Tar-Calion, Pharazôn and Ar-Pharazon to Ar-Pharazôn (16 June 2010);
- Numenor to Númenor (16 June 2010);
- Black Numenoreans and Black Númenórean to Black Númenóreans (16 June 2010);
- Númenoreans, Númenórean, Men of Númenor, Númenorean and Numenoreans to Númenóreans (16 June 2010);
- Adunaic to Adûnaic (16 June 2010);
- Akallabeth, Downfall of Numenor, Drowning of Númenor and The Akallabêth to Akallabêth (16 June 2010);
- Anarion and Anárion son of Elendil to Anárion (16 June 2010);
- Lord of Andúnië to Lords of Andúnië (16 June 2010);
- Andunie to Andúnië (16 June 2010);
- Anduril to Andúril (16 June 2010);
- Eomer and Éomer Éadig to Éomer (16 June 2010);
- Dior and Dior Eluchil to Dior Eluchíl[former link] (16 June 2010);
- Elurin to Elurín (16 June 2010);
- Elured to Eluréd (16 June 2010);
- Man of the West, Men of the West, Núnatani, Núnatan, Dúnadan, Dunadan and Dunedain to Dúnedain (16 June 2010);
- Lothiriel to Lothíriel (16 June 2010);
- Ghan-buri-Ghan to Ghân-buri-Ghân (16 June 2010);
- Old Púkel land to Drúwaith Iaur (16 June 2010);
- Drúath, Drughu, Drûgs, Drûg, Drúadan and Druadan to Drúedain (16 June 2010);
- Barahir son of Bregor to Barahir (16 June 2010);
- Baranor son of Baran to Baranor (son of Baran) (16 June 2010);
- Beren son of Belemir to Beren (son of Belemir) (16 June 2010);
- Elros Tar-Minyatur and Tar-Minyatur to Elros (17 June 2010);
- Earendil and Eärendil the Mariner to Eärendil (17-8 June 2010);
- Brandir of Arachon to Brandir (son of Arachon) (18 June 2010);
- Rian to Rían (18 June 2010);
- Third House of the Edain, People of Hador, Third House and House of Marach to House of Hador (18 June 2010);
- Malach Aradan to Malach (18 June 2010);
- Dunlending language to Dunlendish (20 June 2010);
- Haleth the Hunter to Haleth (20 June 2010);
- Túrin Turambar, Turin and Turindo to Túrin (20 June 2010);
- Morwen Eledhwen to Morwen (20 June 2010);
- Húrin Thalion to Húrin (20 June 2010);
- Gimli Elf-friend to Gimli (28 June 2010);
- Legolas of Mirkwood and Legolas Greenlead to Legolas (1 July 2010);
- Arwen Undómiel, Arwen Undomiel and Arwen Evenstar to Arwen (1 July 2010);
- Gandalf the Grey and Gandalf the White to Gandalf (1 July 2010);
- Frodo to Frodo Baggins (1 July 2010);
- Sam Gamgee, Sam and Samwise to Samwise Gamgee (1 July 2010);
- Merry and Merry Brandybuck to Meriadoc Brandybuck (1 July 2010);
- Pippin, Pippin Took Peregrin Took I and Peregrin I Took to Peregrin Took (1 July 2010);
- Hobbit to Hobbits (1 July 2010);
- Adamanta Took to Adamanta Chubb (2 July 2010);
- Bullroarer to Bandobras Took (2 July 2010);
- Bell Goodchild to Bell Gamgee (2 July 2010);
- Berylla Boffin to Berylla Baggins (2 July 2010);
- Deagol to Déagol (2 July 2010);
- Estella Bolger to Estella Brandybuck (2 July 2010);
- Elanor Gamgee and Elanor Fairbairns to Elanor Gardner (2 July 2010);
- Maggot to Farmer Maggot (2 July 2010);
- Fatty Bolger to Fredegar Bolger (2 July 2010);
- Broadbelt Brandybuck to Gorbadoc Brandybuck (2 July 2010);
- Old Took, Gerontius and The Old Took to Gerontius Took (2 July 2010);
- Hamfast Gamgee and Gaffer to Gaffer Gamgee (2 July 2010);
- Hamfast Gamwich to Hamfast of Gamwich (2 July 2010);
- Hobson Gamgee and Roper Gamgee to Hobson (2 July 2010);
- Lobelia Bracegirdle to Lobelia Sackville-Baggins (2 July 2010);
- Linda Baggins to Linda Proudfoot (2 July 2010);
- Stoor to Stoors (2 July 2010);
- Farmer Cotton to Tolman Cotton Senior (2 July 2010);
- Rosie Cotton to Rose Cotton (2 July 2010);
- Primrose Boffin to Primrose Bracegirdle (2 July 2010);
- Rosamunda Bolger to Rosamunda Took (2 July 2010);
- Goldfather to Rorimac Brandybuck (2 July 2010);
- Smeagol to Sméagol (2 July 2010);
- Burrows to Burrows Family (2 July 2010);
- Brandybuck and Brandybucks to Brandybuck Family (2 July 2010);
- Bolger to Bolger Family (2 July 2010);
- Baggins, Baggins family and Labingi to Baggins Family (2 July 2010);
- Gamgee to Gamgee Family (2 July 2010);
- Chubb-Baggins to Chubb-Baggins Family (2 July 2010);
- Took, Tooks and Took family to Took Family (2 July 2010);
- Sackville-Bagginses and Sackville-Baggins to Sackville-Baggins Family (3 July 2010);
- Proudfoot and Proudfeet to Proudfoot Family (3 July 2010);
- Ainu to Ainur (6 July 2010);
- Aiwendil and Radagast the Brown to Radagast (6 July 2010);
- Aldarion to Tar-Aldarion (6 July 2010);
- Aldarion and Erendis to Aldarion and Erendis: The Mariner's Wife (6 July 2010);
- Amandil of Númenor and Ar-Aphanuzir to Tar-Amandil (6 July 2010);
- Mother-name, Mother-names and Mn to Amilessë (6 July 2010);
- Amon Hen journal to Amon Hen (journal) (6 July 2010);
- Andreas Moehn to Andreas Möhn (7 July 2010);
- Angaráto to Angrod (7 July 2010);
- Anglo-Saxon to Old English (7 July 2010);
- Angrenost to Isengard (7 July 2010);
- Anke Eissman to Anke Eißmann (7 July 2010);
- Annals of Aman to The Annals of Aman (7 July 2010);
- Appendices and The Appendices to The Lord of the Rings Appendices (7 July 2010);
- North-kingdom to Arnor (7 July 2010);
- Nirnaeth Arnoediad and Battle of Unnumbered Tears to Nirnaeth Arnoediad (5 August 2010);
- Bëor the Old to Bëor (5 August 2010);
- Dragon to Dragons (5 August 2010);
- EA to Electronic Arts (5 August 2010);
- Barrow Downs to Barrow-downs (6 August 2010);
- Barrow-wight to Barrow-wights (6 August 2010);
- Battle of Pelennor Fields to Battle of the Pelennor Fields (7 August 2010);
- Farewell Party and Bilbo's Birthday Party to Bilbo's Farewell Party (7 August 2010);
- Amon Sûl to Weathertop (7 August 2010);
- Beleg Strongbow and Beleg Cúthalion to Beleg (7 August 2010);
- Aragorn II Elessar, Aragorn Elessar and Aragorn II to Aragorn (7 August 2010);
- Beren Erchamion to Beren (8 August 2010);
- Category:Dates to <noinclude>[[Category:Dates]]</noinclude> (10 August 2010);
- User:Mith to [[User:Mith/sig]] (1 September 2010);
- CATEGORY to Category (1 September 2010);
- Minas Tirith of Gondor to Minas Tirith (3 September 2010);
- Categorisation of uncategorised TG images and meeting templates (3 September 2010);
- Image:Maedhros_sketch.jpeg to Image:Ivanneth Maedhros.jpg[former link] (21 September 2010);
- Category:Tolkien Gateway:Users to Category:Gatekeepers (7 October 2010);
- Category:User lore-3 to [[Category:User lore-3|{{PAGENAME}}]] (7 October 2010);
- Category:IRC users to [[Category:IRC users|{{PAGENAME}}]] (7 October 2010);
- [[Category:Sandboxes| K]] to [[Category:Sandboxes|K]] (7 October 2010);
- [[Category:Sandboxes]] to [[Category:Sandboxes|{{PAGENAME}}]] (7 October 2010);
- The Book of Lost Tales 1 to The Book of Lost Tales Part One (12 October 2010);
- The Book of Lost Tales 2 and The Book of Lost Tales Party Two to The Book of Lost Tales Part Two (12 October 2010);
- Borondir Udalraph to Borondir (15 October 2010);
- [[Faramir|Faramir]] to Faramir (15 October 2010);
- [[Boromir|Boromir]] to Boromir (15 October 2010);
- [[Beleg|Beleg]] to Beleg (15 October 2010);
- [[Minas Tirith|Minas Tirith]] to Minas Tirith (15 October 2010);
- [[Gandalf|Gandalf]] to Gandalf (15 October 2010);
- [[Malach|Malach]] to Malach (16 October 2010);
- [[Elros|Elros]] to Elros (16 October 2010);
- [[Barahir|Barahir]] to Barahir (16 October 2010);
- [[Anárion|Anárion]] to Anárion (16 October 2010);
- [[Electronic Arts|Electronic Arts]] to Electronic Arts (16 October 2010);
- [[Bilbo's Farewell Party|Bilbo's Farewell Party]] to Bilbo's Farewell Party (16 October 2010);
- [[Lords of Andúnië|Lords of Andúnië]] to Lords of Andúnië (16 October 2010);
- [[Samwise Gamgee|Samwise Gamgee]] to Samwise Gamgee (16 October 2010);
- [[Peregrin Took|Peregrin Took]] to Peregrin Took (16 October 2010);
- [[Hobson|Hobson]] to Hobson (16 October 2010);
- Witch-king of Angmar, Witch King, Lord of the Nazgûl, Black Captain and Witch-King to Witch-king/Witch-king of Angmar (13 December 2010);
- Turgon of Gondolin and Turgon the Wise to Turgon (13 December 2010);
- Orodreth of Nargothrond to Orodreth (13 December 2010);
- Finduilas of Nargothrond to Finduilas (13 December 2010);
- Idril Celebrindal to Idril (14 December 2010);
- Finrod Felagund to Finrod (14 December 2010);
- Gil-Galad, Gilgalad, Ereinion Gil-galad to Gil-galad (14 December 2010);
- Tolkien to J.R.R. Tolkien (14 December 2010);
- The Lord of the Rings: The Battle for Middle-earth II: The Rise of the Witch King and EA's The Battle for Middle-earth II: The Rise of the Witch-king to The Lord of the Rings: The Battle for Middle-earth II: The Rise of the Witch-king (10 January 2011);
- Tolkien Gateway:Help to Help:Contents (10 January 2011);
- J. R. R. Tolkien to J.R.R. Tolkien (10 January 2011);
- S. to Sindarin (10 January 2011);
- Q. to Quenya (10 January 2011);
- Tolkien Gateway:Standards to Tolkien Gateway:Manual of Style (10 January 2011);
- Elf to Elves (10 January 2011);
- Aragorn II to Aragorn (10 January 2011);
- Orc to Orcs (10 January 2011);
- Hobbit to Hobbits (10 January 2011);
- Silmarillion to The Silmarillion (10 January 2011);
- Sam Gamgee to Samwise Gamgee (10 January 2011);
- House of Elrond to Rivendell (10 January 2011);
- Numenor to Númenor (10 January 2011);
- Shire to the Shire (10 January 2011);
- Dwarf to Dwarves (11 January 2011);
- ICE to Iron Crown Enterprises (11 January 2011);
- Vala to Valar (11 January 2011);
- Ñoldor, Deep-elves, Ñoldo, to Noldor (11 January 2011);
- Nirnaeth Arnoediad to Nirnaeth Arnoediad (11 January 2011);
- Lúthien Tinúviel to Lúthien (12 January 2011);
- Elu Thingol to Thingol (13 January 2011);
- Mablung of the Heavy Hand to Mablung (13 January 2011);
- Tale of Years and The Tale of Years to Appendix B (14 January 2011);
- Boromir son of Denethor II to Boromir (14 January 2011);
- Minas Tirith in Gondor to Minas Tirith (14 January 2011);
- White Tower to Tower of Ecthelion (14 January 2011);
- Etymologies to The Etymologies (14 January 2011);
- Ringwraiths, Ringwraith, Winged Nazgûl and Nazgul to Nazgûl (14 January 2011);
- Mallorn journal to Mallorn (journal) (14 January 2011);
- Hithaeglir to Misty Mountains (14 January 2011);
- Hidden City to Gondolin (14 January 2011);
- Common Speech and Common Tongue to Westron (14 January 2011);
- Feanor to Fëanor (14 January 2011);
- Company of the Ring and Fellowship to Fellowship of the Ring (14 January 2011);
- Lothlorien, Lórien in Middle-earth and Laurelindórenan to Lothlórien (14 January 2011);
- War of the Jewels to The War of the Jewels (14 January 2011);
- Great River to Anduin (14 January 2011);
- Balrog to Balrogs (14 January 2011);
- MECCG to Middle-earth Collectible Card Game (14 January 2011);
- MERP to Middle-earth Role Playing (14 January 2011);
- Lord of the Rings Online and LOTRO to The Lord of the Rings Online (14 January 2011);
- Nomenclature and Nomenclature of The Lord of the Rings to Guide to the Names in The Lord of the Rings (14 January 2011);
- Beren Erchamion to Beren (14 January 2011);
- Theoden to Théoden (14 January 2011);
- Túrin Turambar to Túrin (14 January 2011);
- Gondorian to Gondorians (14 January 2011);
- Sinda to Sindar (14 January 2011);
- History of Middle-earth to The History of Middle-earth (14 January 2011);
- One Ring, Ruling Ring and The Ring to the One Ring (14 January 2011);
- Great Sea to Belegaer (14 January 2011);
- Greenwood, Greenwood the Great and Eryn Galen to Mirkwood (14 January 2011);
- Tolkien Society to The Tolkien Society (14-15 January 2011);
- Three Houses of the Edain and Three Houses to Edain (15 January 2011);
- Tower of Orthanc to Orthanc (15 January 2011);
- Noldofinwë to Fingolfin (15 January 2011);
- Template:Gondorian to Template:gondorian infobox (15 January 2011);
- Mardil Voronwë to Mardil (31 January 2011);
- Húrin the Tall to Húrin (Warden of the Keys) (1 February 2011);
- Celeborn, Lord of Lórien and Celeborn (Lord of Lórien) to Celeborn (20 February 2011);
Changing Categories[edit | edit source]
- Category:Images of Peter Jackson's The Return of the King and Category:Images from Peter Jackson's The Return of the King to Category:Images from The Lord of the Rings: The Return of the King (17 November 2010);
- Category:Images from Peter Jackson's The Two Towers to Category:Images from The Lord of the Rings: The Two Towers (17 November 2010);
- Category:Images from Peter Jackson's The Fellowship of the Ring to Category:Images from The Lord of the Rings: The Fellowship of the Ring (17 November 2010);
- Category:Images of the Premiere of Peter Jackson's The Return of the King to Category:Images from the premiere of The Lord of the Rings: The Return of the King[former link] (17 November 2010);
- Category:Images from Peter Jackson's The Lord of the Rings to
- Category:Images from The Lord of the Rings: The Motion Picture Trilogy[former link] (17 November 2010)'
- Category:Images from Rankin/Bass' The Return of the King to Category:Images from The Return of the King (1980 film) (18 November 2010);
- Category:Images from Rankin/Bass' The Hobbit to Category:Images from The Hobbit (1977 film) (18 November 2010);
- Category:Images from Ralph Bakshi's The Lord of the Rings to Category:Images from The Lord of the Rings (1978 film) (18 November 2010);
- Added uncategorised book images to Category:Images of books (15 November 2010);