Template:Cite tweet/doc

A template for citing tweets posted on Twitter.

Usage
{| class="wikitable" style="width: 100%"
 * + Required parameters only, in horizontal format
 * - style="vertical-align:top;"



When known, the author's real name should be specified in the author parameter (or last and first). If their real name is not known, then the tweet is probably not an acceptable usage of a self-published source.

Using sfn and harvid
To use this template with shortened footnotes (e.g. the sfn template), add ref with harvid in the parameter value, like this:



This reference would be cited as.

Optional date parameter
Unlike most citation templates, the date parameter is optional. This is because the date can be calculated directly from the Tweet's ID using Module:TwitterSnowflake (wrapped with Template:TwitterSnowflake).

If the date parameter is off by more than one day from what the calculated date is, the template will output an error. This can be fixed by removing or correcting the date parameter.

If the Tweet was posted before November 4, 2010, the date cannot be calculated from the ID the template will output an error if no date is provided. The template will also provide incorrect dates for tweets posted before November 4, 2010.

Examples
 

 

 

If the author has a Wikipedia article, use of author-link is recommended:  

This tweet was posted before November 4, 2010, so date is necessary:  

Error detection

 * The parameters user, number, and title are . If omitted or left blank, errors will be reported. For example:

Missing or empty |user=
The user parameter is required. The tweet URL is derived from the user and number parameters. If user or number are missing, the URL defaults to https://twitter.com/ Copy the twitter handle (minus the "@" symbol) into this parameter.

Missing or empty |number=
The number parameter is required. The tweet URL and date are derived from number. If user or number are missing, the URL defaults to https://twitter.com/ Copy the long number behind the final   of the tweet's URL into this parameter. For example, if the Tweet URL is, the template requires

Invalid |number=
This error indicates that the required number parameter does not match a tweet's URL. Copy the long number behind the final  of the tweet's URL into this parameter. For example, if the Tweet URL is, the template requires

|date= required
The date parameter is required for tweets posted before November 4, 2010. The date parameter is optional for tweets posted after November 4, 2010, as the date is determined from the number parameter. For earlier tweets, manually type the date into date.

|date= / |number= mismatch
The tweet date is derived from the number parameter for tweets posted after November 4, 2010. If the optional date parameter is used and off by more than a day from the calculated date, an error is displayed. If the number is correct, remove or correct the date.

TemplateData
{	"params": { "number": { "label": "Tweet number", "description": "Numerical ID of the tweet", "type": "number", "required": true },		"user": { "label": "User handle", "description": "Twitter account name, without the @", "type": "string", "required": true },		"title": { "label": "Tweet contents", "description": "Partial or entire content of the tweet, optionally including hashtags (#), at signs (@), and links. Note: double quote marks (\") should be replaced with single quote marks (') because the entire title will display surrounded by double quotes.",			"type": "string",			"required": true		},		"author": {			"label": "Tweet author",			"description": "Author's real name, if known. Will not change to the last name, first name format.",			"type": "string"		},		"author-link": {			"aliases": [				"authorlink"			],			"label": "Author's article",			"description": "Title of existing Wikipedia article about the author",			"type": "wiki-page-name"		},		"retweet": {			"label": "Retweeted by",			"description": "The reliable source who retweeted the tweet, if the original tweeter is not anyone particularly notable. May be wikilinked.",			"type": "string"		},		"date": {			"label": "Date",			"description": "Date of the tweet; do not wikilink; do not include time.",			"type": "date",			"suggested": true		},		"access-date": {			"aliases": [				"accessdate"			],			"label": "Access date",			"description": "The full date when the tweet was accessed; do not wikilink",			"type": "date",			"suggested": true		},		"language": {			"label": "Language",			"description": "The language in which the tweet is written, if not in English.",			"example": "fr",			"type": "string"		},		"location": {			"label": "Tweet location",			"description": "The location from which a tweet was sent.",			"example": "London",			"type": "string"		},		"archive-url": {			"label": "Archive URL",			"aliases": [				"archiveurl"			],			"description": "The URL of an archived copy of a web page, if or in case the URL becomes unavailable; requires 'archive-date'", "type": "url" },		"archive-date": { "label": "Archive date", "aliases": [ "archivedate" ],			"description": "Date when the original URL was archived; do not wikilink", "type": "date" },		"url-status": { "label": "URL status", "description": "If set to 'live', the title displays as the live link; if set to dead, the title displays as the archive link", "type": "string" },		"script-title": { "label": "Tweet script", "description": "For tweets in languages that do not use a Latin-based alphabet (Arabic, Chinese, Cyrillic, Greek, Hebrew, Japanese, Korean, Vietnamese, etc). Prefix with two-character ISO639-1 language code followed by a colon, e.g. for Japanese use: ja:...", "example": "ja:東京タワー", "type": "string" },		"trans-title": { "label": "Translated tweet", "description": "An English language translation, if the tweet cited is in a foreign language; use of 'language' parameter is recommended", "type": "string" },		"link": { "label": "Link to Twitter article?", "description": "Set to \"no\" to not link to the Wikipedia article for Twitter. Useful for preventing overlinking when more than one tweet is cited.", "type": "boolean" },		"df": { "label": "Date format", "description": "Valid values: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all", "type": "string" },		"ref": { "label": "Ref anchor", "description": "An anchor identifier; can be made the target of wikilinks to full references", "type": "string" },		"quote": { "label": "Quote", "description": "Relevant text quoted from the source; displays last, enclosed in quotes; must include terminating punctuation", "type": "string" },		"first": { "aliases": [ "first1" ],			"label": "First name", "description": "The first name of the author, if known. If not known, then the tweet is probably not an acceptable usage of a self-published source (see WP:SPS).", "type": "string", "suggested": true },		"last": { "label": "Last name", "description": "The last name of the author.", "type": "string", "suggested": true }	},	"description": "A template for citing tweets posted on Twitter.", "paramOrder": [ "number", "user", "title", "first", "last", "author", "author-link", "retweet", "date", "access-date", "language", "location", "archive-url", "archive-date", "url-status", "script-title", "trans-title", "link", "df", "quote", "ref" ],	"format": "" }