YOU CAN EDIT THIS PAGE! Just click any blue "Edit" link and start writing!

Wikitravel:Script nominations

From Wikitravel
Revision as of 10:17, 5 May 2009 by Tatata (talk | contribs)
Jump to: navigation, search

According to the Wikitravel script policy, scripts have to be approved by the Wikitravel administrators. To create a script that runs against Wikitravel, post the name and reason for the script beneath the line below.

Explain why we need the script, why it can't be done by hand, and what the script will do. If 2 administrators voice their support for the script within 7 days, and none oppose it in that period, the script can be run.

Scripts that have passed through this process can be found in Wikitravel:Approved scripts.


I'd like to create a script to add "isIn" information for as many articles as possible. We've done a lot by hand already, but I think it might make sense to do a pass automatically. I'm calling it "YggdrasilBot", since its intention is to build a Tree of the World. I think it'll be tricky, but here's how it will work:

  1. It will start with the main 7 continents as input, plus other top-level areas like Central America and the Caribbean.
  2. For each input article, it will read the article, and look for sections of the article with particular names ("Sections", "Regions", "Countries", "Other destinations", "Districts", "States", "Provinces", "Counties", etc.). This will be configurable so that we can use the same bot for different language versions.
  3. In each of those article sections, it will look for links of the form "* [[Link]]" -- that is, only links where the link is the first item in a top-level list. This is the Wikitravel:Manual of style format for listing regions, cities, etc. It will ignore second- or higher-level links in hierarchical lists, and links embedded in text.
  4. It will add the articles referenced by the links to its queue of input articles.
  5. It will note that the input article is a parent for each of the linked articles -- making a two-way relationship between the article being read and the linked articles.
  6. Once it has finished with the input, it will do some calculations on the graph it's built. For each node (destination), it will look at each parent. It will discard any parent that is an ancestor of one of its other parents. Then, it will choose the first parent out of the remaining list.
  7. After the calculations are done, for each node, it will check to see if the article for the node exists, and if node already has a parent defined (by reading the RDF data). If it exists and doesn't already have a parent, the bot will append an {{isIn|Parent}} template to the bottom of the article.

I'm going to write this over the next few days (either in Pywikipediabottish or Perl + WWW::Mediawiki::Client), and run it next week (pending approval). The code will be available here and from my arch repository.

I'm trying to be as conservative as possible with this, but I'm going to try it out on a test repository first. --Evan 15:37, 9 Dec 2005 (EST)

Support. As soon as it can run on even the most conservative and obvious cases please get it running. -- Colin 00:23, 11 Dec 2005 (EST)
Good idea = Support. A point though. While regions are able to be parts of the branches, the cities can only be the leaves on the end. The regions should have city destinations listed on them, the cities (except huge ones with districts) should not. Also, if a city has an appearance in multiple region articles then the most distant or deepest region should be chosen as the IsIn link. There should also be some consistency, with all city articles off the same region, including the existing ones, getting the same IsIn link. Thus if an IsIn link already exists on a sister page then the validity of that IsIn should be checked for consistency with all the other sister pages. This could also mean not adding an IsIn link if there are too many sister links off one page - possibly because there need to be more regions. Finally, in situations where regions are not built out, but cities are, there is the potential for the IsIn link to be misassigned too early in the tree. This could be overcome by the Bot changing the IsIn link once a region is built out or else reporting misplaced IsIn's, excessive IsIn's and missing region pages. The assumption here is that a human added IsIn is more reliable than a Bot one. -- Huttite 00:59, 11 Dec 2005 (EST)
First: the point of step 6 is to make sure that only the deepest region is used. Second, what about adding a lint comment to the talk page of articles that have weird conditions? That would give us the benefit of the automated tool without writing to the actual article when there's a strange case. --Evan 13:04, 12 Dec 2005 (EST)
Support. This is similar to User:Elgaard#Wikitravel_as_book (which I hope to replace by a script that use isIn). --elgaard 16:35, 11 Dec 2005 (EST)
I'd support this as a maintenance tool, but would it be possible to first create a list of articles that still need isIn information, and then wait a week or two to see how many people can manually set up? At the moment it seems like isIn is doing wonders for getting people to create parent regions and more clearly decide what belongs where, so there seems to be some value in holding off for a bit longer. -- Ryan 16:43, 11 Dec 2005 (EST)
Support. Ryan has made a good point though..... Why don't we hold off on running the bot until after New Year....? Paul James Cowie 18:35, 11 Dec 2005 (EST)
Me too. I don't think this is terribly urgent, so let's let humans to the hard part first. Jpatokal 01:32, 12 Dec 2005 (EST)
Just for info sake: I just did a query and of 6164 non-redirect, non-disambiguation pages in the main namespace, 1536 have a link to the "isin" template. How about this: I'll the script ready to go and run it against a test database, and then let's wait till January to run it. I'd like to actually have it go on scheduled basis once every few days to keep the entire site well-stitched. --Evan 12:55, 12 Dec 2005 (EST)
I'm for the script, especially if it uses the perl library, and if you give me some feedback on its design and any bugs you find. -- Mark 04:58, 12 Dec 2005 (EST)
How would you handle the case of one place belonging to two regions, such as Lake Tahoe or Niagara Falls? Also some links that this bot should look at have "The" or some other short word before them. -phma 09:35, 21 Dec 2005 (EST)
I support the script as well. Having nearly 5000 articles to do by hand would take an awfully long time, so automation is good. Weekly sounds nice, too. -- Ilkirk 10:30, 30 Dec 2005 (EST)
Can the bot update a Special:Yggdrasil or a Wikitravel:Yggdrasil page with the actual tree of the world? I am thinking of a page where the world's continents, countries, regions, states and cities are shown in the form of a hierarchical tree, which can be expanded and collapsed when needed? It would be great if the article's status were also shown, so if I want to find all the stub articles under India, I could do it at one go. --Ravikiran 05:25, 4 Jan 2006 (EST)


As part of the autotranslation feature I'm going to start testing a bot and adding autotranslations to subpages of article Talk pages (ie /Parigi:Discussione/Translation for an Italian version of the English article or /Talk:Cologne/Translation for a english version of the German article). I'm going to start out with half-a-dozen or so, for feedback, and then work on small batches where it would be useful. Majnoona 14:26, 1 July 2006 (EDT)


WikiPedia currently runs a bot named WikiPedia:User:AntiVandalBot which uses pattern matching to revert obvious vandalism. The vandalism reversions it makes seem to be remarkably accurate and include everything from the "Bob is gay" edits to page blanking (see WikiPedia:Special:Contributions/AntiVandalBot). It also leaves a note on the user page for an author whose change was reverted, and will not revert a change twice when in "calm" mode, which is the default - there is also an "angry" mode. They have a WikiPedia:User:AntiVandalBot/requests page for getting it to run on Wikis other than Wikipedia, and I'd like to try to get it running on English Wikitravel. Should there be any problems with the bot the failsafe is for an admin to block the user the bot runs under, so it seems like it would be safe enough. -- Ryan 17:43, 18 July 2006 (EDT)

  • Support. Tawkerbot2 does fine work on Wikipedia. For the few pages I have on my watchlist, it usually gets the silly vandalism first before anyone else has a chance to take a whack at it. I've reviewed takwerbot2's contribution log a few times, and it looks perfect to me. -- Colin 17:53, 18 July 2006 (EDT)
  • Question: WikiPedia:User:Tawkerbot2/requests mentions a cost for the software; is this an issue? - Todd VerBeek 19:24, 20 July 2006 (EDT)
    • If that is an issue I don't see why we can't handle vandalism manually. Of course it'd be nice not to have to worry about a cleverly hidden "I want to eat your children", "Bob is gay", or Aside from the aforementioned concern of cost the Tawkerbot page also says something about needing a seperate server to run off of would that be a problem? -- Andrew Haggard (Sapphire) 19:32, 20 July 2006 (EDT)
    • The comment about a fee has been added recently, and it wasn't added by the script's author so it's not clear to me if it's a fee that's going to be charged, or if it was just a suggestion by someone else to start charging. If I make a request to get the bot running here and they say there's a fee then all bets are off - this is just something that would be "nice to have", it's not a necessity. As to a separate server, I think that's the script's author saying he wants a separate server to run it from, although I guess he's also looking at a P2P solution. -- Ryan 19:35, 20 July 2006 (EDT)
      • We can run it off the old server (it just runs the mailing lists, now... and my blog, and Maj's home page, and a couple of other miscellaneous sites); I'm not sure how I feel about any additional fees for use, but I can ask IB about it. --Evan 19:46, 20 July 2006 (EDT)
  • Support, provided everything pans out. -- Andrew Haggard (Sapphire) 19:43, 20 July 2006 (EDT)
  • A couple notes on the fee thing, mostly that was mentioned as we were in a major server crunch at the time and neither of us could afford the $150 or so a month a server capable of running it on all the wikis. In short the script right now can be grabbed from an svn, do you have an IRC recent changes feed, that's the one other major thing that it needs. -- 12:23, 21 July 2006 (EDT)
    • A feed can be set up if needed, just let us know any next steps by leaving a comment on my talk page or on User_talk:Evan#Tawkerbot. -- Ryan 16:02, 21 July 2006 (EDT)
      • I gotta say, though: these notices are generated in MediaWiki, then sent to an IRC server, and read by a bot, then sent through a Web interface back to the MediaWiki server... it sure seems like the long way around the block! --Evan 16:10, 21 July 2006 (EDT)
        • So should we just do manual reverts or click the rollback button instead? - Andrew
          • No, I'm just wondering if we could short-circuit the process by taking the pipe where warnings come out and twist it around so it fits into the hole where reverts go in. --Evan 17:08, 21 July 2006 (EDT)
            • Update: the bot has been renamed and as of 24 October 2006 is running on a new machine, so with any luck we might see some action on this one soon. -- Ryan 03:09, 2 November 2006 (EST)

SpamFilterBot 2.0

So Evan and I were discussing various ideas about Wikitravel and I think it would be great if we could get a bot up and running which updates the spam filter across all language versions, Shared, and review and keeps all of the spam filters consistent so to prevent EN spammers from spamming ES, IT, etc. Who ever writes the script gets a barnstar. On the count of three... 1... 2... GO! -- Andrew Haggard (Sapphire) 23:25, 6 August 2006 (EDT)

Would it be easier to just have a single spam filter on shared? -- Ryan 22:11, 15 August 2006 (EDT)


As updating DotMs/OtBPs by hand is annoying (update front page, place into index, remove from current discussion, slot into archive), I'd like to build a bot along the lines of DiscoverBot to automate the process. (Wikipedia might have something snarfable.) Ideally, it could maintain all Wikitravel language versions that have active DoTM processes, and it would be smart enough to do nothing if the queue is empty. Jpatokal 02:14, 1 November 2006 (EST)

  • Support. Dotmodroid is a good name, but when will we see the JaniBot? -- Ryan 02:44, 1 November 2006 (EST)
What would JaniBot do? Travel the world, apply for Indian visas for people, speak eight languages semi-decently and write new scripts for more bots? -- Andrew H. (Sapphire) 03:05, 6 November 2006 (EST)
"Would"? Ha! The useless bloated sac of protoplasm known as User:Jpatokal was long since terminated and replaced by JaniBot. Prepare to be assimilated. -- JaniBot 03:08, 6 November 2006 (EST)
 :) -- Andrew H. (Sapphire) 03:14, 6 November 2006 (EST)
This came to mind after reading this. -- Andrew H. (Sapphire) 04:19, 25 November 2006 (EST)
  • Support. Sounds like a good way to deal with a tedious task. --Evan 10:43, 2 November 2006 (EST)
  • Support. Have I made life easier or tougher for the bot by modifying the format of the DotM candidates page? I am guessing easier, as it can just snarf the stuff between the div tags, but you never know with bots... — Ravikiran 21:23, 13 November 2006 (EST)


I noted this morning that someone had started Newark, New Jersey when we already had a Newark (New Jersey). I wonder if it would be useful to have a bot that added redirects for US and Canadian towns where a comma-separated city-and-state is a common naming convention. I'd probably just use the US and Canadian cities from the UN/LOCODE list, which would leave out the dots-on-the-map, but would cover most of the countries. It would make redirects of the form City, State and City, ST to City (State) or just City (depending on if the article exists). --Evan 14:22, 22 November 2006 (EST)

When the article already exists as "City", how do you plan to ensure that it is the right city? Walk the isIn tree until you get to a state? Check for a Wikipedia link? (I mention this half as clarification, and half as "I may want to do something similar") Do you plan on making these redirects only for existing articles? -- Colin 15:29, 22 November 2006 (EST)


  • Maintainer: Dorgan
  • Job: Interwiki
  • Program: Pywikipedia

-- Dorgan 09:48, 10 July 2007 (EDT)

Support. The functionality is identical to the deceased and much missed InterLangBot, and the cough test run just now shows that it seems to work fine, so I propose we waive the 7-day waiting period if Evan is willing to toggle the bot switches (this being one of those few bureaucrat-only tasks). One question though: does the bot handle UTF8 properly? Can it run in Japanese, Hindi, Hebrew etc as well? Jpatokal 10:00, 10 July 2007 (EDT)
Yes, it's UTF-8, and working fine, and of course, its working other languages. The source is here! ( Dorgan 10:16, 10 July 2007 (EDT)
You also need to hack to check the bot flags -- see [1]. Jpatokal 12:15, 10 July 2007 (EDT)
I understand. My problem is: I cracked that file, I copied it to and it doesn't work. I think this crack is out of date and unfortunatelly I can't resolve to check the two pages. And in interwiki there is another problem too: if my main language is hungarian, and I set the two pages in hu wt (if it's working :)) how can you stop me if you don't know the main language? OR if you know, how can I know the stop isn't an affray (if anonymous)? Could you review the script policy? The STOP is for the admins I think (like wps too)! Dorgan 03:57, 11 July 2007 (EDT)
The bot is supposed to check the flags on the language version it's currently editing. The code above is very simple, all you need to do is change the URLs to point to User:DorganBot/Run and Wikitravel:Script policy/Run. Jpatokal 04:35, 11 July 2007 (EDT)
Yes, I know, I chaged that, and nothing.... Dorgan 04:49, 11 July 2007 (EDT)
Ok, my last question: yes I know, that's not wp, but I think interwiki bot isn't dangerous. You see I have a bot since 2006 nov (in en, it, ro, ru, nl, fi, fr, de, hu wikipedias) more than 13 000 edits just in hu (the most edits are interwiki!). So I couldn't resolve the two check page, but Can I have the bot flag? :) Dorgan 04:09, 11 July 2007 (EDT)
It's not a question of is it dangerous. The question is, does it follow Wikitravel policy? If not, then we either 1) don't let it run on Wikitravel, or we 2) ignore policy in this case, or 3) we change the policy. My opinion: maybe we should drop the onerous article-checking requirements of our current script policy, so that useful tools like the pywikipediabot suite will be compliant. I think that we've got enough admins around that blocking ill-behaved bots is practical. --Evan 19:41, 15 July 2007 (EDT)
Not yet. I'd like to know that it's working according to our Wikitravel:script policy. I'm going to look over the code. --Evan 10:43, 10 July 2007 (EDT)
Since the bot has previously seemed to work OK, and Evan's not around too much these days, and the comment above is pretty ambiguous anyway, and this discussion has been dragging on for way too long, I'm going to tentatively say that the bot is approved — we'll just block it if there are problems. Jpatokal 13:09, 1 November 2007 (EDT)
Does anybody have an idea what has happend to this bot? It did a really good job, unfortunatly no edits any more since March 2008. --Flip666 writeme! • 05:13, 10 February 2009 (EST)


I've started to operate this bot on Japanese version[2], and I can contribute to English version as a substitute for DorganBot.

  • Operator: ja:User:Tatata(Tatata)
  • Function:
    • maintaining interlanguage links
    • replacing text (templates / internal links)
  • Operation: manually
  • Software: Python
  • Bot flags: ja[3]

On English version, I'll use only the function of maintaining interlanguage links by myself. As to the function of replacing text, it will be used by request if someone needs help.

By the way, I would like to use this bot on Chinese version too. But there are no documents about script nor script nomination process because there is only one admin. ;-) Can I apply a bot flag for Chinese version here? -- Tatata 22:03, 27 April 2009 (EDT)

  • Support -- this is long overdue! And yes, I'll be happy to enable the bot flag on fi and zh. Jpatokal 01:09, 28 April 2009 (EDT)
Thank you Jani-san. I created some accounts (en, fi, zh) and /Run page (zh:Wikitravel:腳本方針/Run). How can I spell "Script policy" in Suomi? "Komentosarja käytännöt", right? -- Tatata 21:16, 29 April 2009 (EDT)
Bot flags enabled on fi, zh. There's no good Finnish word for "script" in this sense (komentosarja is a manual command sequence), so the policy page is now at fi:Wikitravel:Botit ("Bots") and the flag at fi:Wikitravel:Botit/Run. Jpatokal 02:48, 30 April 2009 (EDT)
I moved Chinese page from "zh:Wikitravel:腳本方針/Run" to "zh:Wikitravel:機器人方針/Run", because of the same reason though I cannot understand Chinese well ;-)
The bot has started working on fi, zh! -- Tatata 22:14, 30 April 2009 (EDT)
  • Support. I'm so tired of marking interwiki links as patrolled :-) -- Colin 02:51, 30 April 2009 (EDT)
Thank you Colin-san. -- Tatata 22:14, 30 April 2009 (EDT)