Last active
January 25, 2023 19:37
-
-
Save thompcha/1a9718512de310ff0c79a0b40a4f7ee1 to your computer and use it in GitHub Desktop.
Userscript that displays how long the current rip has been running in Automatic Ripping Machine (ARM)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ARM Rip Elapsed | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show elapsed time of current rip | |
// @author thompcha | |
// @include http://*.*.*.*:8080/history | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js | |
// @license FSFAP | |
// ==/UserScript== | |
$( document ).ready(function() { | |
var start = $('tr:eq(1) td:first').text(); | |
var start_parsed = moment(start,'DD-MM-YYYY hh:mm:ss') | |
setInterval(function(){ | |
var elapsed = moment.duration(moment().diff(start_parsed)); | |
var elapsed_formatted = moment.utc(elapsed.as('milliseconds')).format('H:mm:ss'); | |
$('tr:eq(1) td:eq(2)').html(elapsed_formatted); | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment