Skip to content

Instantly share code, notes, and snippets.

@thompcha
Last active January 25, 2023 19:37
Show Gist options
  • Save thompcha/1a9718512de310ff0c79a0b40a4f7ee1 to your computer and use it in GitHub Desktop.
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)
// ==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