Skip to content

Instantly share code, notes, and snippets.

@happiness801
Last active October 18, 2025 17:24
Show Gist options
  • Select an option

  • Save happiness801/37f3514b765e9b565bbf633d010fef56 to your computer and use it in GitHub Desktop.

Select an option

Save happiness801/37f3514b765e9b565bbf633d010fef56 to your computer and use it in GitHub Desktop.
Add Totals to Tello Mobile Activity Page
// ==UserScript==
// @name Tello Mobile - Activity Totals
// @namespace http://onai.net/
// @version 0.1
// @description Summarizes Tello Mobile Activity Page to show Totals by Category
// @author Kevin Gwynn
// @match https://tello.com/account/activity*
// @grant none
// ==/UserScript==
(function() {
// Make sure jQuery is available
var gen = 0;var act=function(){gen=1;var script=document.createElement('script');script.src='//code.jquery.com/jquery-1.11.0.min.js';script.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(script);};(!window.jQuery)?act():1;setTimeout(function(){console.log('jQuery '+(gen?'loaded: ':'existing: ')+(window.jQuery?jQuery().jquery:'no jQuery/load failed'));}, 500);
var addTotals = function() {
// DATA USAGE
let totalMB = 0;
$('tr[data-product_type="data"] td:nth-child(4)').each(function() {
let text = $(this).text().trim(); // e.g., "5.4 MB"
let value = parseFloat(text); // extract numeric part
if (!isNaN(value)) {
totalMB += value;
}
});
let totalGB = totalMB / 1024;
console.log(`Total: ${totalGB.toFixed(2)} GB`);
let formattedGB = totalGB.toFixed(2);
// Create the new section
let usageSection = `
<div class="margin_vertical30">
<p class="color_blue font_ubuntu font-weight700 font-size24 x-heading-2xl">
Data Usage
</p>
<p class="margin0">Total Usage for this period: ${formattedGB} GB</p>
</div>
`;
$('.my_account_section').after(usageSection);
}
setTimeout(addTotals, 500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment