number of revisions: <inputtype="range"name="numrevs"min="1"max="100"value="10"/>
number of revisions: <inputtype="range"name="numrevs"min="1"max="100"value="10"/>
<buttonid="generate">generate script</button>
<buttonid="generate">generate script</button>
</div>
</div>
@ -39,7 +57,9 @@
<divclass="body"></div>
<divclass="body"></div>
</div>
</div>
<divid="revisions"></div>
<divid="revisions"></div>
<scriptsrc="difftime.js"></script>
<script>
<script>
const dateFormat = new Intl.RelativeTimeFormat('en', { style: 'long' });
let r = {
let r = {
action: "compare",
action: "compare",
format: "json",
format: "json",
@ -57,6 +77,7 @@
let api_url = "https://en.wikipedia.org/w/api.php"
let api_url = "https://en.wikipedia.org/w/api.php"
// let url = "https://en.wikipedia.org/w/api.php?action=compare&format=json&fromtitle=Han%20Kang&fromrev=376586279&totitle=Han%20Kang&torelative=next&formatversion=2&origin=*";
// let url = "https://en.wikipedia.org/w/api.php?action=compare&format=json&fromtitle=Han%20Kang&fromrev=376586279&totitle=Han%20Kang&torelative=next&formatversion=2&origin=*";
let generate = document.querySelector("button#generate");
let generate = document.querySelector("button#generate");