2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								#!/usr/bin/env ruby
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$:.unshift('../vendor/ruby-mediawiki/lib')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require 'mediawiki/dotfile'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@wiki = MediaWiki.dotfile(nil,'camp')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								def parse_template(title, template)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  template_re = Regexp.new("\\\{\\\{" + template + "(.*?)\\\}\\\}", Regexp::MULTILINE)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  info = []
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (scanned = @wiki.article(title).text.scan(template_re)) != []
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scanned.each do |m|
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      fields = {}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      fields_string = m[0]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      inlink = 0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      field = ""
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      fields_string += "|" unless fields_string.match(/\|$/)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      fields_string.split(//).each do |c|
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if c == "|" && inlink == 0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          (key, value) = field.split(/=/)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          value.chomp! if value
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          fields[key] = value
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          field = ""
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        else
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          inlink += 1 if c == "["
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          inlink -= 1 if c == "]"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          field += c
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      info << fields
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  else
							 
						 
					
						
							
								
									
										
										
										
											2007-07-13 09:24:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    $stderr.print "Template #{template} not found in #{title}!\n"
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								  end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  info
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-08-02 18:32:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								list = "
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								<!-- 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 _   _ _____ _     _     ___    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| | | | ____| |   | |   / _ \   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| |_| |  _| | |   | |  | | | |  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								|  _  | |___| |___| |__| |_| |  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								|_| |_|_____|_____|_____\___( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            |/  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								-->
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								''This is an auto-generated list - please use [[Template:Workshop]] (description is there) to include your workshop here. Contact [[User:Neingeist|Neingeist]] if you have problems or questions (Jabber is preferred.)''
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@wiki.category("Workshop").articles.each do |article|
							 
						 
					
						
							
								
									
										
										
										
											2007-07-13 09:24:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  if article != "Template:Workshop" && article != "List of workshops" && article != "ExampleVille"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    workshops = parse_template(article, "Workshop")
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    workshops.each do |workshop|
							 
						 
					
						
							
								
									
										
										
										
											2007-08-02 18:32:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      list += "* '''[[#{article}|#{workshop["what"]}]]''' "
							 
						 
					
						
							
								
									
										
										
										
											2007-07-13 09:24:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      if workshop["day"] != ""
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        list += "Day " + workshop["day"] + "/" + workshop["start"]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      end
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								      list += "\n"
							 
						 
					
						
							
								
									
										
										
										
											2007-08-03 23:34:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      list += ":''#{workshop["where"]} ''\n"
							 
						 
					
						
							
								
									
										
										
										
											2007-08-02 18:32:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      list += "::#{workshop["abstract"]}\n"
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								end
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-08 12:25:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								list += "\n[[Category:Workshop]]\n"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								puts list
							 
						 
					
						
							
								
									
										
										
										
											2007-07-06 01:20:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								a = @wiki.article("List of workshops")
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								a.text = list
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								a.submit("wiki ex machina")
							 
						 
					
						
							
								
									
										
										
										
											2007-07-13 09:24:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								a.protect("Automatically generated article")