Module:Studio debug: Difference between revisions
From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
Isolate the licence lookup (via update-page on MediaWiki MCP Server) |
Dump the bytes of the record name (via update-page on MediaWiki MCP Server) |
||
| Line 3: | Line 3: | ||
local p = {} | local p = {} | ||
function p.bytes( frame ) | |||
local raw = frame:callParserFunction( "#ask", { | local raw = frame:callParserFunction( "#ask", { | ||
"[[Has performer::Harry Clark]]", | "[[Has performer::Harry Clark]]", | ||
"?Has track name=track", | "?Has track name=track", | ||
"mainlabel=record", | "mainlabel=record", | ||
"link=none", | "link=none", | ||
| Line 17: | Line 15: | ||
"template=Studio appearance row", | "template=Studio appearance row", | ||
} ) | } ) | ||
local unstripped = mw.text.unstrip( raw or "" ) | |||
local record = unstripped:match( "^(.-)||" ) or unstripped | |||
local record = | record = record:match( "^([^#]*)" ) or record | ||
local out = { "len=" .. #record .. " [" } | |||
for i = 1, #record do | |||
local | table.insert( out, string.byte( record, i ) .. " " ) | ||
end | |||
table.insert( out, "]" ) | |||
return "<pre>" .. table.concat( out ) .. "</pre>" | |||
return | |||
end | end | ||
return p | return p | ||
Revision as of 21:43, 17 September 2026
Documentation for this module may be created at Module:Studio debug/doc
-- Temporary. Delete once Module:Studio sessions is behaving.
local p = {}
function p.bytes( frame )
local raw = frame:callParserFunction( "#ask", {
"[[Has performer::Harry Clark]]",
"?Has track name=track",
"mainlabel=record",
"link=none",
"searchlabel=",
"limit=200",
"format=plainlist",
"sep=@@",
"template=Studio appearance row",
} )
local unstripped = mw.text.unstrip( raw or "" )
local record = unstripped:match( "^(.-)||" ) or unstripped
record = record:match( "^([^#]*)" ) or record
local out = { "len=" .. #record .. " [" }
for i = 1, #record do
table.insert( out, string.byte( record, i ) .. " " )
end
table.insert( out, "]" )
return "<pre>" .. table.concat( out ) .. "</pre>"
end
return p