Last active
November 16, 2017 16:08
-
-
Save TristanWiley/b49989a02a42970729ab8c863c4309ec to your computer and use it in GitHub Desktop.
A script to tell me how much Moes/Guac and Roll I've eaten. Run on CBord's GET summary page. Select "meals". https://get.cbord.com/myubcard/full/history.php
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
var resturants = []; | |
var totals = {}; | |
$('.scrollContent tr').each(function( index ) { | |
var resturant = $(this).find(".activity_details").text(); | |
if(resturant == "XML Interface - Meal Plan Sele") return; | |
if(totals[resturant]){ | |
totals[resturant]++; | |
}else{ | |
totals[resturant] = 1; | |
} | |
}); | |
console.log("You've been to Moes a total of " + totals["Moes"] + " times"); | |
console.log("You've been to Guac and Roll a total of " + totals["Guac & Roll"] + " times"); | |
console.log("That's a total of " + (totals["Moes"] + totals["Guac & Roll"]) + " meals of Mexican Food."); | |
console.log("You've spent " + Object.values(totals).reduce((a,b) => a+b, 0) + " meal swipes."); | |
console.log("Here's all your totals"); | |
console.log(totals); |
Author
TristanWiley
commented
Nov 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment