<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://cookerpedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite_tweet</id>
	<title>Module:Cite tweet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cookerpedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite_tweet"/>
	<link rel="alternate" type="text/html" href="https://cookerpedia.org/index.php?title=Module:Cite_tweet&amp;action=history"/>
	<updated>2026-05-03T15:57:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://cookerpedia.org/index.php?title=Module:Cite_tweet&amp;diff=1063&amp;oldid=prev</id>
		<title>Eggman: Created page with &quot;local p = {} local TwitterSnowflake = require('Module:TwitterSnowflake') local CiteWeb = require('Module:Cite web')['']  local function _if(arg) 	return arg and arg ~= '' or nil end  p.main = function(frame) 	frame.args = frame:getParent().args 	return p[''](frame) end  p[''] = function(frame) 	local args = frame.args 	local cite_args = { 		url 		= 'https://twitter.com/' .. ((args.user and args.number) and (args.user .. '/status/' .. args.number) or ''), 		title		= (args...&quot;</title>
		<link rel="alternate" type="text/html" href="https://cookerpedia.org/index.php?title=Module:Cite_tweet&amp;diff=1063&amp;oldid=prev"/>
		<updated>2022-02-13T06:04:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} local TwitterSnowflake = require(&amp;#039;Module:TwitterSnowflake&amp;#039;) local CiteWeb = require(&amp;#039;Module:Cite web&amp;#039;)[&amp;#039;&amp;#039;]  local function _if(arg) 	return arg and arg ~= &amp;#039;&amp;#039; or nil end  p.main = function(frame) 	frame.args = frame:getParent().args 	return p[&amp;#039;&amp;#039;](frame) end  p[&amp;#039;&amp;#039;] = function(frame) 	local args = frame.args 	local cite_args = { 		url 		= &amp;#039;https://twitter.com/&amp;#039; .. ((args.user and args.number) and (args.user .. &amp;#039;/status/&amp;#039; .. args.number) or &amp;#039;&amp;#039;), 		title		= (args...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local TwitterSnowflake = require('Module:TwitterSnowflake')&lt;br /&gt;
local CiteWeb = require('Module:Cite web')['']&lt;br /&gt;
&lt;br /&gt;
local function _if(arg)&lt;br /&gt;
	return arg and arg ~= '' or nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = function(frame)&lt;br /&gt;
	frame.args = frame:getParent().args&lt;br /&gt;
	return p[''](frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p[''] = function(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local cite_args = {&lt;br /&gt;
		url 		= 'https://twitter.com/' .. ((args.user and args.number) and (args.user .. '/status/' .. args.number) or ''),&lt;br /&gt;
		title		= (args.title or ''):gsub('https*://', ''),&lt;br /&gt;
		['script-title'] = args['script-title'],&lt;br /&gt;
		['trans-title'] = args['trans-title'],&lt;br /&gt;
		language	= args.language,&lt;br /&gt;
		['author-link'] = args['author-link'] or args.authorlink,&lt;br /&gt;
		others		= _if(args.retweet) and ('Retweeted by ' .. args.retweet),&lt;br /&gt;
		via 		= args.link == 'no' and 'Twitter' or '[[Twitter]]',&lt;br /&gt;
		type		= 'Tweet',&lt;br /&gt;
		location	= args.location,&lt;br /&gt;
		['access-date'] = args['access-date'] or args.accessdate,&lt;br /&gt;
		['archive-date'] = args['archive-date'] or args.archivedate,&lt;br /&gt;
		['archive-url'] = args['archive-url'] or args.archiveurl,&lt;br /&gt;
		['url-status'] = args['url-status'] or args['dead-url'] or args.deadurl,&lt;br /&gt;
		quote	= args.quote,&lt;br /&gt;
		ref			= args.ref,&lt;br /&gt;
		df			= args.df&lt;br /&gt;
	}&lt;br /&gt;
	if _if(args.last1 or args.last) then&lt;br /&gt;
		cite_args.author = (args.last1 or args.last) ..&lt;br /&gt;
			(_if(args.first1 or args.first) and (', ' .. (args.first1 or args.first)) or '') ..&lt;br /&gt;
			' [@' .. (args.user or '') .. ']'&lt;br /&gt;
	elseif _if(args.author1 or args.author) then&lt;br /&gt;
		cite_args.author = (args.author1 or args.author) .. ' [@' .. (args.user or '') .. ']'&lt;br /&gt;
	elseif _if(args['author-link']) then&lt;br /&gt;
		cite_args.author = args['author-link'] .. ' [@' .. (args.user or '') .. ']'&lt;br /&gt;
	else&lt;br /&gt;
		cite_args.author = '@' .. (args.user or '')&lt;br /&gt;
	end&lt;br /&gt;
	if cite_args.author:find ('[Tt]witter') then&lt;br /&gt;
		cite_args.author = '((' .. cite_args.author .. '))'&lt;br /&gt;
	end&lt;br /&gt;
	if _if(tonumber(args.number)) then&lt;br /&gt;
		cite_args.date = args.date or (_if(args.number) and TwitterSnowflake.snowflakeToDate{ args = {id_str = args.number} })&lt;br /&gt;
	else&lt;br /&gt;
		cite_args.date = args.date&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	frame.args = cite_args&lt;br /&gt;
	local output = CiteWeb(frame)&lt;br /&gt;
	frame.args = args&lt;br /&gt;
	&lt;br /&gt;
	-- Error checking&lt;br /&gt;
	local error_template = '&amp;lt;span class=&amp;quot;cs1-visible-error citation-comment&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;'&lt;br /&gt;
	local errors = {}&lt;br /&gt;
	if not (_if(args.title) or _if(args['script-title']) or args.user or args.number or args.date) then&lt;br /&gt;
		-- No title; error message is provided by CS1 module.&lt;br /&gt;
		errors[1] = ';'&lt;br /&gt;
	end&lt;br /&gt;
	if not _if(args.user) then&lt;br /&gt;
		errors[1 + #errors] = ' Missing or empty &amp;lt;kbd&amp;gt;&amp;amp;#124;user=&amp;lt;/kbd&amp;gt;;'&lt;br /&gt;
	end&lt;br /&gt;
	if not _if(args.number) then&lt;br /&gt;
		errors[1 + #errors] = ' Missing or empty &amp;lt;kbd&amp;gt;&amp;amp;#124;number=&amp;lt;/kbd&amp;gt;;'&lt;br /&gt;
	end&lt;br /&gt;
	errors[1 + #errors] = TwitterSnowflake.datecheck{ args = {&lt;br /&gt;
		id_str	= args.number or '',&lt;br /&gt;
		date	= args.date or '',&lt;br /&gt;
		error1	= ' &amp;lt;kbd&amp;gt;&amp;amp;#124;date=&amp;lt;/kbd&amp;gt; mismatches calculated date from &amp;lt;kbd&amp;gt;&amp;amp;#124;number=&amp;lt;/kbd&amp;gt; by two or more days;',&lt;br /&gt;
		error2  = ' Missing or empty &amp;lt;kbd&amp;gt;&amp;amp;#124;date=&amp;lt;/kbd&amp;gt;, and posted before November 4, 2010;',&lt;br /&gt;
		error3	= ' Invalid &amp;lt;kbd&amp;gt;&amp;amp;#124;number=&amp;lt;/kbd&amp;gt; parameter;'&lt;br /&gt;
	}}&lt;br /&gt;
	if errors[1] then&lt;br /&gt;
		local last = errors[#errors]&lt;br /&gt;
		errors[#errors] = last:sub(1, #last - 1) .. ' ([[Template:Cite_tweet#Error_detection|help]])'&lt;br /&gt;
		local error_out = error_template:rep(#errors):format(unpack(errors)) &lt;br /&gt;
		if mw.title.getCurrentTitle():inNamespace(0) then&lt;br /&gt;
			error_out = error_out .. '[[Category:Cite tweet templates with errors]]'&lt;br /&gt;
		end&lt;br /&gt;
		output = output .. error_out&lt;br /&gt;
	end&lt;br /&gt;
	return output&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Eggman</name></author>
	</entry>
</feed>