Volatile:ListField

Revision as of 21:17, 5 June 2012 by Editor (talk | contribs)


Search Results of {{{1}}}

{{#lua:

 function trim(s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end
 list = {}
 id = {}
 for page,data in stdin:gmatch("&&([%S]+)&&{{{1}}} *= *([^\n]+)") do
   if ((data ~= "-") and (data ~= " ")) then
     data = trim(data)
     tmp = list[data]
     if (tmp == nil) then
       list[data] = { page }
       table.insert(id, data)
     else
       table.insert(tmp, page)
     end
   end
 end
 table.sort(id)
 print("Total " .. table.getn(id) .. " groups.")
 local coff = tonumber("0")
 if (coff == nil) then coff =0 else print("Showing groups more than size=" .. coff .. "only") end
 for _,v in ipairs(id) do
   if (table.getn(list[v]) > coff) then
     print("* " .. v .. "")
     table.sort(list[v])
     for i = 1,table.getn(list[v]) do
       if (list[v][i] ~= list[v][i + 1]) then
         print("[[{{{2}}}:" .. list[v][i] .."|".. list[v][i] .."]]") end
     end
   end
 end

|

}}