<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="vi">
	<id>https://bktt.vn/index.php?action=history&amp;feed=atom&amp;title=M%C3%B4_%C4%91un%3AWikidataCheck</id>
	<title>Mô đun:WikidataCheck - Lịch sử thay đổi</title>
	<link rel="self" type="application/atom+xml" href="https://bktt.vn/index.php?action=history&amp;feed=atom&amp;title=M%C3%B4_%C4%91un%3AWikidataCheck"/>
	<link rel="alternate" type="text/html" href="https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:WikidataCheck&amp;action=history"/>
	<updated>2026-04-04T07:20:34Z</updated>
	<subtitle>Lịch sử thay đổi của trang này ở wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:WikidataCheck&amp;diff=5290&amp;oldid=prev</id>
		<title>Taitamtinh: Tạo trang mới với nội dung “local p = {}  function p.wikidatacheck(frame) 	local pframe = frame:getParent() 	local config = frame.args -- the arguments passed BY the template, in the…”</title>
		<link rel="alternate" type="text/html" href="https://bktt.vn/index.php?title=M%C3%B4_%C4%91un:WikidataCheck&amp;diff=5290&amp;oldid=prev"/>
		<updated>2020-10-28T16:52:04Z</updated>

		<summary type="html">&lt;p&gt;Tạo trang mới với nội dung “local p = {}  function p.wikidatacheck(frame) 	local pframe = frame:getParent() 	local config = frame.args -- the arguments passed BY the template, in the…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Trang mới&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.wikidatacheck(frame)&lt;br /&gt;
	local pframe = frame:getParent()&lt;br /&gt;
	local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
	local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template&lt;br /&gt;
&lt;br /&gt;
	local property = config.property&lt;br /&gt;
	local value = config.value or &amp;quot;&amp;quot;&lt;br /&gt;
	local catbase = config.category&lt;br /&gt;
	local namespaces = config.namespaces&lt;br /&gt;
	local nocatsame = config.nocatsame or &amp;quot;&amp;quot;&lt;br /&gt;
	local ok = false -- one-way flag to check if we're in a good namespace&lt;br /&gt;
	local ns = mw.title.getCurrentTitle().namespace&lt;br /&gt;
	for v in mw.text.gsplit( namespaces, &amp;quot;,&amp;quot;, true) do&lt;br /&gt;
		if tonumber(v) == ns then&lt;br /&gt;
			ok = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if not ok then -- not in one of the approved namespaces&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local entity = mw.wikibase.getEntityObject()&lt;br /&gt;
	if not entity then -- no Wikidata item&lt;br /&gt;
		return &amp;quot;[[Thể loại:&amp;quot; .. catbase .. &amp;quot; không có trên Wikidata]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if value == &amp;quot;&amp;quot; then&lt;br /&gt;
		return nil -- Using Wikidata&lt;br /&gt;
	end&lt;br /&gt;
	local claims = entity.claims or {}&lt;br /&gt;
	local hasProp = claims[property]&lt;br /&gt;
	if not hasProp then -- no claim of that property&lt;br /&gt;
		return &amp;quot;[[Thể loại:&amp;quot; .. catbase .. &amp;quot; không có trên Wikidata]]&amp;quot; -- bad. Bot needs to add the property&lt;br /&gt;
	end&lt;br /&gt;
	for i, v in ipairs(hasProp) do -- Now we try to iterate over all possible values?&lt;br /&gt;
		propValue = (v.mainsnak.datavalue or {}).value&lt;br /&gt;
		if propValue == value then&lt;br /&gt;
			if nocatsame == &amp;quot;&amp;quot; then&lt;br /&gt;
				return &amp;quot;[[Thể loại:&amp;quot; .. catbase .. &amp;quot; giống như Wikidata]]&amp;quot; -- yay!&lt;br /&gt;
			else&lt;br /&gt;
				return nil -- if nocatsame, the &amp;quot;same as&amp;quot; category is not added&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;quot;[[Thể loại:&amp;quot; .. catbase .. &amp;quot; khác với Wikidata]]&amp;quot; -- needs human review :(&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Taitamtinh</name></author>
	</entry>
</feed>