How many times have I been to the Y?

Preface

When the first semester of college started, I visited the Y pretty often, in fact, I went almost 5 times on the first day.

Because of this, I thought it would be interesting to tally how many times I’ve been to the Y. However, as time went on, I only really went to the Y twice a day once class started, and the number quickly became dully average.

Reintroduction

Last week, someone I know showed me that I can actually see a history of every swipe in at a dining hall, and use that to calculate the total number of entries I made into any dining hall.

The data was suprisingly robust, with the exact date and time of entry provided down to the second, which gave me the idea to make a tool to analyze the data more closely.

Fetching the data

UMD doesn’t provide any API or official way to access the data. Normally, I would just scrape the data like I did with gradevuer, however, UMD uses proper 2FA and a UMD account is a lot more sensitive then an MCPS account. So scraping was basically impossble.

This led me to a less than ideal solution, in which the user pastes a script into the console and pastes the result into the tool. The script fetches the page and parses the html to create JSON, and the source is below.

const start = "6/1/2025";
const end = "1/1/2027";

const request = await fetch("https://dsonline2.umd.edu/dpmsonline/mealtranswithdates.do", {
  "headers": {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language": "en-US,en;q=0.9",
    "content-type": "application/x-www-form-urlencoded",
  },
  "referrer": "https://dsonline2.umd.edu/dpmsonline/mealtranswithdates.do",
  "body": `startdate=${encodeURIComponent(start)}&enddate=${encodeURIComponent(end)}`,
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
});

const text = await request.text();

const parser = new DOMParser();
const doc = parser.parseFromString(text, "text/html");

const table = doc.getElementById("balance-trans");
const rows = Array.from(table.rows).slice(1);

function convertRowToObject(row) {
  const arr = row.innerText.split('\n')
    .map(entry => entry.trim())
    .filter(entry => entry != "");

  return {
    plan: arr[0],
    location: arr[1],
    time: arr[2],
    use_count: arr[3],
    balance: arr[4]
  }
};

const object = rows.map(convertRowToObject);
object

The data

This script then returns JSON data with every transaction made with your UMD dining account.

As I mentioned earlier, this data is actually pretty detailed. I didn’t really put this to too much use however, I just made graphs for the distribution of dining halls, the time of day you most frequently enter, the months you most frequently entered, and the days of the week you most frequently entered.

The data includes a lot more, including purchases made with dining dollars, guest pass uses, and other things I was too lazy to further explore.

Try it out

The tool is freely available, try it out.

Now, to answer the question, I’ve been to the Y 295 times.