Module:Sandbox/User:Alsang/PriceChecker: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
Californ1a (talk | contribs) mNo edit summary |
Californ1a (talk | contribs) m (Undo revision 55025 by Californ1a (talk)) Tag: Undo |
||
Line 1:
local p = {}
end▼
▲-- Non-dynamic module, no inputs
function p.main()
}
for _, item in ipairs(results) do▼
if not(tonumber(item.ShopValue)==tonumber(item.InfoboxValue)) then
return table.concat(out, '<br>')
▲ table.insert(out, item)
end
|
Revision as of 11:04, 4 December 2024
Module documentation
This documentation is transcluded from Module:Sandbox/User:Alsang/PriceChecker/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:Sandbox/User:Alsang/PriceChecker/doc. [edit]
Module:Sandbox/User:Alsang/PriceChecker's function main is invoked by Template:Sandbox/User:Alsang/PriceChecker.
local p = {}
-- non dynamic module, no inputs
function p.main()
-- returns only directly needed parameter needed for the row,
-- other parameters are determined by subqueries of chained pages
local query = {
'[[-Sold item::~*]]',
'?=Name',
'?-Sold item.Shop sell price=ShopValue',
'?Value=InfoboxValue',
'limit = 500'
}
local results = mw.smw.ask(query)
local out = {}
for _,item in ipairs(results) do
if not(tonumber(item.ShopValue)==tonumber(item.InfoboxValue)) then
table.insert(out,item.Name)
end
end
return table.concat(out, '<br>')
end
return p