<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.npowned.net/index.php?action=history&amp;feed=atom&amp;title=Module%3ARankedWars%2Fdata%2Fdoc</id>
	<title>Module:RankedWars/data/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.npowned.net/index.php?action=history&amp;feed=atom&amp;title=Module%3ARankedWars%2Fdata%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;action=history"/>
	<updated>2026-04-27T21:06:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=7013&amp;oldid=prev</id>
		<title>Bobogoobo at 22:38, 13 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=7013&amp;oldid=prev"/>
		<updated>2026-01-13T22:38:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:38, 13 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Updating ranked wars==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Updating ranked wars==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To update ranked wars data, run the following code on this page and copy the result from the console to [[Module:RankedWars/data.json]]. Be sure to fill in your public API key on the second line. Make sure there are no errors in the editor or the saved page. You should also check the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;diff &lt;/del&gt;from the page history after saving, as this will reveal any faction shells that have changed name and need to be added to the corrections here.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To update ranked wars data, run the following code on this page and copy the result from the console to [[Module:RankedWars/data.json]]. Be sure to fill in your public API key on the second line. Make sure there are no errors in the editor or the saved page. You should also check the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;edit differences (&quot;Show changes&quot; while editing, or &lt;/ins&gt;from the page history after saving&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;, as this will reveal any faction shells that have changed name and need to be added to the corrections here.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{collapsible content|title=Expand to show code|state=collapsed|width=50%|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{collapsible content|title=Expand to show code|state=collapsed|width=50%|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bobogoobo</name></author>
	</entry>
	<entry>
		<id>https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=6154&amp;oldid=prev</id>
		<title>Bobogoobo at 07:14, 19 October 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=6154&amp;oldid=prev"/>
		<updated>2025-10-19T07:14:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:14, 19 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Updating ranked wars==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Updating ranked wars==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To update ranked wars data, run the following code on this page and copy the result from the console to [[Module:RankedWars/data.json]]. Be sure to fill in your public API key on the second line. Make sure there are no errors in the editor or the saved page.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To update ranked wars data, run the following code on this page and copy the result from the console to [[Module:RankedWars/data.json]]. Be sure to fill in your public API key on the second line. Make sure there are no errors in the editor or the saved page&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. You should also check the diff from the page history after saving, as this will reveal any faction shells that have changed name and need to be added to the corrections here&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{collapsible content|title=Expand to show code|state=collapsed|width=50%|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{collapsible content|title=Expand to show code|state=collapsed|width=50%|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bobogoobo</name></author>
	</entry>
	<entry>
		<id>https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=6059&amp;oldid=prev</id>
		<title>Bobogoobo: updated the updating</title>
		<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=6059&amp;oldid=prev"/>
		<updated>2025-10-17T20:19:55Z</updated>

		<summary type="html">&lt;p&gt;updated the updating&lt;/p&gt;
&lt;a href=&quot;https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;amp;diff=6059&amp;amp;oldid=5978&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Bobogoobo</name></author>
	</entry>
	<entry>
		<id>https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=5978&amp;oldid=prev</id>
		<title>Bobogoobo: for safekeeping</title>
		<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:RankedWars/data/doc&amp;diff=5978&amp;oldid=prev"/>
		<updated>2025-10-15T03:10:18Z</updated>

		<summary type="html">&lt;p&gt;for safekeeping&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
&lt;br /&gt;
Run the following code on the /data page and copy the result from the console to [[Module:RankedWars/data.json]]. Be sure to fill in your public API key on the second line.&lt;br /&gt;
&lt;br /&gt;
{{collapsible content|title=Expand to show code|state=collapsed|width=50%|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot; copy=&amp;quot;copy&amp;quot;&amp;gt;&lt;br /&gt;
//Get each of our factions&amp;#039; RW history from the Torn API, calculate stats, and output json format for storage.&lt;br /&gt;
//By Bobogoobo [2618206] for NPOWiki&lt;br /&gt;
(function () {&lt;br /&gt;
	//todo: store constants in a data module and run script from that page, instead of having to update two places every time. Easier to import elsewhere also. JSON would be &amp;#039;wars&amp;#039; only.&lt;br /&gt;
	var apiKey = &amp;#039;&amp;#039;;// requires public access key&lt;br /&gt;
	if (!apiKey) return &amp;#039;API key required&amp;#039;;&lt;br /&gt;
	var rw_release = &amp;#039;2021-12-07&amp;#039;;&lt;br /&gt;
	//Full list of shells we have used. Please keep shell lists in reverse chronological order.&lt;br /&gt;
	//Dates are approximate due to transition time, merely following official announcements.&lt;br /&gt;
	//Ranges are contiguous to avoid missing any events.&lt;br /&gt;
	var factions = {&lt;br /&gt;
		strength: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 10610,&lt;br /&gt;
				start: &amp;#039;2022-10-03&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Old shell (now Prosperity)&amp;#039;,&lt;br /&gt;
				id: 44758,&lt;br /&gt;
				start: &amp;#039;2020-02-09&amp;#039;,&lt;br /&gt;
				end: &amp;#039;2022-10-03&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
		prosperity: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 44758,&lt;br /&gt;
				start: &amp;#039;2022-10-14&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Old shell (sold to PimpChu)&amp;#039;,&lt;br /&gt;
				id: 11162,&lt;br /&gt;
				start: &amp;#039;2021-10-16&amp;#039;,&lt;br /&gt;
				end: &amp;#039;2022-10-14&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Older shell (now Cry of the Lost)&amp;#039;,&lt;br /&gt;
				id: 44751,&lt;br /&gt;
				start: &amp;#039;2020-02-09&amp;#039;,&lt;br /&gt;
				end: &amp;#039;2021-10-16&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
		endurance: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 12645,&lt;br /&gt;
				start: &amp;#039;2024-05-05&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Old shell (now Serenity)&amp;#039;,&lt;br /&gt;
				id: 14052,&lt;br /&gt;
				start: &amp;#039;2022-08-03&amp;#039;,&lt;br /&gt;
				end: &amp;#039;2024-05-05&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
		valour: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 26885,&lt;br /&gt;
				start: &amp;#039;2023-12-31&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
		serenity: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 14052,&lt;br /&gt;
				start: &amp;#039;2024-05-05&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
		peace: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Current shell&amp;#039;,&lt;br /&gt;
				id: 18714,&lt;br /&gt;
				start: &amp;#039;2022-07-16&amp;#039;,&lt;br /&gt;
				end: &amp;#039;&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		],&lt;br /&gt;
	};&lt;br /&gt;
	//Indexed by RW id, please keep in reverse chronological order (i.e. descending).&lt;br /&gt;
	//Note that NPO faction name will be automatically corrected from the shell list.&lt;br /&gt;
	//Only note termed if it WAS termed. Use notes only in extreme cases.&lt;br /&gt;
	//Possible keys: opponent (string), termed (boolean), note (string)&lt;br /&gt;
	//***** LAST UPDATED: STR V NAUGHTY SOULS 19 SEP *****//&lt;br /&gt;
	var corrections = {&lt;br /&gt;
		30645: { termed: true },&lt;br /&gt;
		29810: { termed: true },&lt;br /&gt;
		29532: { termed: true },&lt;br /&gt;
		29101: { termed: true },&lt;br /&gt;
		26763: { termed: true },&lt;br /&gt;
		26698: { termed: true },&lt;br /&gt;
		26378: { termed: true },&lt;br /&gt;
		25785: { termed: true },&lt;br /&gt;
		25233: { termed: true },&lt;br /&gt;
		25092: { termed: true },&lt;br /&gt;
		24748: { termed: true },&lt;br /&gt;
		23498: { termed: true },&lt;br /&gt;
		23168: { termed: true },&lt;br /&gt;
		22993: { termed: true },&lt;br /&gt;
		22809: { termed: true },&lt;br /&gt;
		22648: { termed: true },&lt;br /&gt;
		22621: { termed: true },&lt;br /&gt;
		22547: { termed: true },&lt;br /&gt;
		22408: { termed: true },&lt;br /&gt;
		21844: { termed: true },&lt;br /&gt;
		21648: { termed: true },&lt;br /&gt;
		21417: { termed: true },&lt;br /&gt;
		21146: { note: &amp;#039;uncontested&amp;#039; },&lt;br /&gt;
		19540: { termed: true },&lt;br /&gt;
		18181: { termed: true },&lt;br /&gt;
		17986: { termed: true },&lt;br /&gt;
		17544: { termed: true },&lt;br /&gt;
		17403: { termed: true },&lt;br /&gt;
		17128: { termed: true },&lt;br /&gt;
		16972: { termed: true },&lt;br /&gt;
		16603: { termed: true },&lt;br /&gt;
		16061: { termed: true },&lt;br /&gt;
		15850: { termed: true },&lt;br /&gt;
		15559: { termed: true },&lt;br /&gt;
		15425: { termed: true },&lt;br /&gt;
		15107: { termed: true },&lt;br /&gt;
		15016: { termed: true },&lt;br /&gt;
		11546: { termed: true },&lt;br /&gt;
		11136: { termed: true },&lt;br /&gt;
		9765: { termed: true },&lt;br /&gt;
		9588: { termed: true },&lt;br /&gt;
		9418: { termed: true },&lt;br /&gt;
		9310: { termed: true },&lt;br /&gt;
		9302: { termed: true },&lt;br /&gt;
		7633: { termed: true },&lt;br /&gt;
		7066: { termed: true },&lt;br /&gt;
		7103: { termed: true },&lt;br /&gt;
		7015: { termed: true },&lt;br /&gt;
		6444: { termed: true },&lt;br /&gt;
		6384: { termed: true },&lt;br /&gt;
		5536: { termed: true },&lt;br /&gt;
		5341: { termed: true },&lt;br /&gt;
		5307: { termed: true },&lt;br /&gt;
		5190: { termed: true },&lt;br /&gt;
		3706: { termed: true },&lt;br /&gt;
		3632: { termed: true },&lt;br /&gt;
		3536: { termed: true },&lt;br /&gt;
		3439: { termed: true },&lt;br /&gt;
		3305: { termed: true },&lt;br /&gt;
		3253: { termed: true },&lt;br /&gt;
		1592: { opponent: &amp;#039;39th Street Killers XR&amp;#039; },&lt;br /&gt;
	};&lt;br /&gt;
	//todo: add corrections from history file - just need to look at names next. May need to make some exceptions for when we fight ourselves?&lt;br /&gt;
	//todo: I put termed for anything that says Derank, but some of the early ones predate terming and there may not have been an official agreement.&lt;br /&gt;
	//	Can usually tell from score anyway, but may want to put notes where needed&lt;br /&gt;
	&lt;br /&gt;
	var wars = {// wars by faction, newest first; keys same as in &amp;quot;factions&amp;quot;&lt;br /&gt;
		overall: {},&lt;br /&gt;
	};&lt;br /&gt;
	var requests = {&lt;br /&gt;
		pending: 0,&lt;br /&gt;
		completed: 0,&lt;br /&gt;
		failed: 0,&lt;br /&gt;
		ignoredWars: 0,&lt;br /&gt;
	};&lt;br /&gt;
	&lt;br /&gt;
	async function requestWarHistory(shell, facName, offset, limit) {&lt;br /&gt;
		var url = &amp;#039;https://api.torn.com/v2/faction/&amp;#039;;&lt;br /&gt;
		url = url.concat(&lt;br /&gt;
			shell.id,&lt;br /&gt;
			&amp;#039;/rankedwars?offset=&amp;#039;,&lt;br /&gt;
			offset,&lt;br /&gt;
			&amp;#039;&amp;amp;limit=&amp;#039;,&lt;br /&gt;
			limit,&lt;br /&gt;
			&amp;#039;&amp;amp;key=&amp;#039;,&lt;br /&gt;
			apiKey,&lt;br /&gt;
			&amp;#039;&amp;amp;comment=NPOWiki-RW&amp;#039;,&lt;br /&gt;
		);&lt;br /&gt;
		try {&lt;br /&gt;
			var response = await fetch(url);&lt;br /&gt;
			if (!response.ok) {&lt;br /&gt;
				var error = &amp;#039;Request error:&amp;#039;;&lt;br /&gt;
				error = error.concat(&lt;br /&gt;
					&amp;#039; status &amp;#039;,&lt;br /&gt;
					response.status,&lt;br /&gt;
					&amp;#039; for faction &amp;#039;,&lt;br /&gt;
					shell.id,&lt;br /&gt;
					&amp;#039; with offset &amp;#039;,&lt;br /&gt;
					offset,&lt;br /&gt;
				);&lt;br /&gt;
				throw new Error(err);&lt;br /&gt;
			}&lt;br /&gt;
			var data = await response.json();&lt;br /&gt;
			requests.completed += 1;&lt;br /&gt;
			processWarHistory(data, shell, facName, offset, limit);&lt;br /&gt;
		} catch (err) {&lt;br /&gt;
			requests.failed += 1;&lt;br /&gt;
			console.error(err);&lt;br /&gt;
			//todo: handle error&lt;br /&gt;
		} finally {&lt;br /&gt;
			requests.pending -= 1;&lt;br /&gt;
			if (requests.pending &amp;lt; 1 &amp;amp;&amp;amp; requests.completed + requests.failed &amp;gt; 0) {&lt;br /&gt;
				finalize();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	function processWarHistory(data, shell, facName, offset, limit) {&lt;br /&gt;
		data.rankedwars.forEach(function (war) {&lt;br /&gt;
			var relevant = false;&lt;br /&gt;
			//todo: simplify?&lt;br /&gt;
			if (war.start &amp;gt; shell.startUnix &amp;amp;&amp;amp; (!shell.endUnix || war.start &amp;lt; shell.endUnix)) {&lt;br /&gt;
				//War started after shell, and shell is current or war started before shell ended&lt;br /&gt;
				relevant = true;&lt;br /&gt;
			} else if ((shell.endUnix &amp;amp;&amp;amp; war.end &amp;amp;&amp;amp; war.end &amp;lt; shell.endUnix) || (!shell.endUnix &amp;amp;&amp;amp; !war.end)) {&lt;br /&gt;
				//Shell ended and war ended before it, or shell and war are current&lt;br /&gt;
				relevant = true;&lt;br /&gt;
			} else if (war.end &amp;amp;&amp;amp; war.end &amp;gt; shell.startUnix &amp;amp;&amp;amp; war.end &amp;lt; shell.endUnix) {&lt;br /&gt;
				//War ended after shell started but before it ended&lt;br /&gt;
				relevant = true;&lt;br /&gt;
			}&lt;br /&gt;
			if (relevant) {&lt;br /&gt;
				var usFirst = war.factions[0].id === shell.id;&lt;br /&gt;
				var usData = war.factions[+!usFirst];&lt;br /&gt;
				var themData = war.factions[+usFirst];&lt;br /&gt;
				// &amp;quot;chain&amp;quot; property appears to be worthless. Not sure about forfeit?&lt;br /&gt;
				var warData = {&lt;br /&gt;
					id: war.id,&lt;br /&gt;
					start: war.start,&lt;br /&gt;
					end: war.end,&lt;br /&gt;
					shell: usData.id,&lt;br /&gt;
					opponent: themData.id,&lt;br /&gt;
					oppName: themData.name,&lt;br /&gt;
					win: war.winner === shell.id,&lt;br /&gt;
					termed: false,&lt;br /&gt;
					target: war.target,&lt;br /&gt;
					ourScore: usData.score,&lt;br /&gt;
					oppScore: themData.score,&lt;br /&gt;
				};&lt;br /&gt;
				var correction = corrections[war.id];&lt;br /&gt;
				if (correction) {&lt;br /&gt;
					if (correction.opponent) {&lt;br /&gt;
						warData.oppName = correction.opponent;&lt;br /&gt;
					}&lt;br /&gt;
					if (correction.termed) {&lt;br /&gt;
						warData.termed = true;&lt;br /&gt;
					}&lt;br /&gt;
					if (correction.note) {&lt;br /&gt;
						warData.note = correction.note;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				wars[facName][war.id] = warData;&lt;br /&gt;
			} else {&lt;br /&gt;
				requests.ignoredWars += 1;&lt;br /&gt;
				//todo: track ignored wars, but maybe handle when looking up same shell multiple times&lt;br /&gt;
			}&lt;br /&gt;
		});&lt;br /&gt;
		if (data._metadata.links.next) {&lt;br /&gt;
			offset += limit;&lt;br /&gt;
			requests.pending += 1;&lt;br /&gt;
			setTimeout(requestWarHistory, 750, shell, facName, offset, limit);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	function finalize() {&lt;br /&gt;
		Object.keys(factions).forEach(function (faction) {&lt;br /&gt;
			wars.overall[faction] = {&lt;br /&gt;
				wars: 0,&lt;br /&gt;
				wins: 0,&lt;br /&gt;
				losses: 0,&lt;br /&gt;
				termedWins: 0,&lt;br /&gt;
				termedLosses: 0,&lt;br /&gt;
			};&lt;br /&gt;
			var stats = wars.overall[faction];&lt;br /&gt;
			Object.keys(wars[faction]).forEach(function (war) {&lt;br /&gt;
				war = wars[faction][war]&lt;br /&gt;
				stats.wars += 1;&lt;br /&gt;
				if (war.win) {&lt;br /&gt;
					stats.wins += 1;&lt;br /&gt;
					if (war.termed) {&lt;br /&gt;
						stats.termedWins += 1;&lt;br /&gt;
					}&lt;br /&gt;
				} else {&lt;br /&gt;
					stats.losses += 1;&lt;br /&gt;
					if (war.termed) {&lt;br /&gt;
						stats.termedLosses += 1;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			});&lt;br /&gt;
		});&lt;br /&gt;
		console.log(JSON.stringify({factions, wars, corrections}, null, &amp;#039;\t&amp;#039;));&lt;br /&gt;
		console.log(requests);&lt;br /&gt;
		//todo&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	Object.keys(factions).forEach(function (faction, i) {&lt;br /&gt;
		var limit = 100;// maximum limit&lt;br /&gt;
		&lt;br /&gt;
		wars[faction] = {};&lt;br /&gt;
		factions[faction].forEach(function (shell, j) {&lt;br /&gt;
			//Torn and Lua use seconds, not milliseconds&lt;br /&gt;
			shell.startUnix = Date.parse(shell.start) / 1000;&lt;br /&gt;
			shell.endUnix = Date.parse(shell.end) / 1000;&lt;br /&gt;
			&lt;br /&gt;
			var offset = 0;&lt;br /&gt;
			requests.pending += 1;&lt;br /&gt;
			setTimeout(requestWarHistory, 500 * (i + 1) * (j + 1), shell, faction, offset, limit);&lt;br /&gt;
		});&lt;br /&gt;
	});&lt;br /&gt;
	//todo: consider if worth calling rankedwarreport - definitely would be nice to have full stats.&lt;br /&gt;
	//	Maybe a separate script that can pull from this one&amp;#039;s output? Although having it all together and only one script to run would be nice&lt;br /&gt;
	//todo: war 14015 was fought by END on May 10-11 2024, need to adjust shell move date to Serenity.&lt;br /&gt;
})();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Lua data modules]]&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bobogoobo</name></author>
	</entry>
</feed>