Anonymous user
Module:Cite tweet: Difference between revisions
support |quote
m (Changed protection level for "Module:Cite tweet": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))) |
imported>Nardog (support |quote) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 29: | Line 29: | ||
['archive-url'] = args['archive-url'] or args.archiveurl, | ['archive-url'] = args['archive-url'] or args.archiveurl, | ||
['url-status'] = args['url-status'] or args['dead-url'] or args.deadurl, | ['url-status'] = args['url-status'] or args['dead-url'] or args.deadurl, | ||
quote = args.quote, | |||
ref = args.ref, | ref = args.ref, | ||
df = args.df | df = args.df | ||
Line 43: | Line 44: | ||
cite_args.author = '@' .. (args.user or '') | cite_args.author = '@' .. (args.user or '') | ||
end | end | ||
cite_args.date = args.date or (_if(args.number) and TwitterSnowflake.snowflakeToDate{ args = {id_str = args.number} }) | if cite_args.author:find ('[Tt]witter') then | ||
cite_args.author = '((' .. cite_args.author .. '))' | |||
end | |||
if _if(tonumber(args.number)) then | |||
cite_args.date = args.date or (_if(args.number) and TwitterSnowflake.snowflakeToDate{ args = {id_str = args.number} }) | |||
else | |||
cite_args.date = args.date | |||
end | |||
frame.args = cite_args | frame.args = cite_args | ||
Line 50: | Line 58: | ||
-- Error checking | -- Error checking | ||
local error_template = '<span class="cs1-visible- | local error_template = '<span class="cs1-visible-error citation-comment">%s</span>' | ||
local errors = {} | local errors = {} | ||
if not (_if(args.title) or _if(args['script-title']) or args.user or args.number or args.date) then | if not (_if(args.title) or _if(args['script-title']) or args.user or args.number or args.date) then |