Comparing Machines by Region

Using the data available on the pinball map, a user can determine what machines are availble in other regions that aren't available at home. This could be very useful for someone traveling and wanting to experience machines that are unavailbe in their own region.

The code to determine what machines are available in a different region is very similar to the code we've already used several times before with a few twists:

  function getMachines(region) {
          var req = new XMLHttpRequest();
"GET", '' + region + '/location_machine_xrefs.json', false);
          var data = JSON.parse(req.responseText);

          var machines = []
          for (machine in data.location_machine_xrefs) {
            var machineName = data.location_machine_xrefs[machine];
            var machineLocation = data.location_machine_xrefs[machine]
            machines.push({'name':machineName, 'location':machineLocation});
          return machines;

    var portlandMachines = getMachines('portland');
    var bayAreaMachines = getMachines('bayarea');

    var notInPortland = [];
    for (var i=0; i<bayAreaMachines.length; i++) {
      var machineFound = false;
      for(var j=0; j<portlandMachines.length; j++) {
        if (bayAreaMachines[i].name === portlandMachines[j].name) {
          machineFound = true;
      if (!machineFound) {

In the getting started portion of this write up, we determined the various region names. Using that knowledge we are able to fetch all the machines in a given region. In this example, we look at what machines are in the Bay Area, but not in Portland, OR. It would be easy to generalize this code to have a website where a user enters the two zones of interest to get a list of machines at one region and not the other back. For simplicity in this example, we didn't go quite so far with the generalizations. To make the information sent back to the user most useful, the location of the machine is included with the machine name so the potential player can know where to go upon finding a machine they are excited to go check out.

Running the above script and appending the first several entries to a table gives us the following:

Machines in Bay Area and not Portland
RavenFree Gold Watch
Spin WheelPacific Pinball Museum
Operation ThunderPacific Pinball Museum
CrosswordPacific Pinball Museum
Pro-FootballPacific Pinball Museum
Flying CarpetPacific Pinball Museum
Black KnightCafe du Nord
Dolly PartonFireside, The
CheckpointFree Gold Watch
Harley-Davidson (Sega)Quarter Note, The
Revenge from MarsSilver Creek Sportsplex
Super JumboPacific Pinball Museum
Show BoatPacific Pinball Museum
PixiesPacific Pinball Museum
Kewpie DollPacific Pinball Museum
Drop-a-CardPacific Pinball Museum
Dancing DollsPacific Pinball Museum
ApolloPacific Pinball Museum
Travel TimePacific Pinball Museum
High SpeedPacific Pinball Museum
Baby Pac-ManPacific Pinball Museum
Dr. DudeBrewcade
Lethal Weapon 3Free Gold Watch
MillionaireFree Gold Watch
Mr. & Mrs. Pac-ManFree Gold Watch
Punchy the ClownPacific Pinball Museum
Strange WorldPacific Pinball Museum
KnockoutPacific Pinball Museum
AirbornePacific Pinball Museum
2001Pacific Pinball Museum
Spider-Man BlackMetreon
Whoa Nellie! Big Juicy MelonsPhoenix Games

The full list of machines found in the Bay area but not Portland can be seen here.

Wrap Up

Finding games not available in your home town can be useful for finding games you haven't been able to play locally when planning trips! It wouldn't take much more work to make a functioning app to compare region by region what machines are available. In our last analytics task, we will be looking at how to compare all high scores in the pinball map API to find the highest score posted for each machine.