scraping squash matrix

scraping squash matrix

Squash matrix is the Australian squash ranking and content management system for all squash players, teams, and clubs.

Although the squash community is large there isn't enough excitement and ownership of information on any level, including individuals through to clubs and regions.

Squash Australia while managing content only allows match information to be uploaded and viewed, which is fantastic if you live and breath squash through your browser, but the rest of the world is getting their weather from their fridges and hearing about local news on google home.

This SDK hopes to reduce the barrier for ownership of information by providing a Ruby SquashMatrix::Client enabling interactions with the squash matrix platform.

The SDK (at the time of writing this) is on revision 1.0.3 and available at rubygems.org/gems/squash_matrix with documentation.

client = SquashMatrix::Client.new(player: 42547, password: "foo") # initialize client
=> SquashMatrix::Client
client.get_player_info(42547) # retrieve player info for joshua wilkosz #42547
=> {
  :name =>"Joshua Wilkosz"
  :rating=>"250.202",
  :clubs=>[
    {
      :name=>"Melbourne University (2011-2017)",
      :id=>336
    }
  ],
  :teams=>[
    {
      :name=>"Melbourne University (2) (2017)",
      :id=>72831
    }
  ]
}
client.get_player_results(42547) # retrieve player results for joshua wilkosz #42547
=> [
  {
    :event=>"2017 Melbourne Autumn  State Open Pennant",
    :division=>"State 2",
    :round=>"7",
    :position=>"3",
    :games=>"2-3",
    :points=>"67-73",
    :rating_adjustment=>0.58,
    :rating=>250.2,
    :opponent_rating=>275.24,
    :opponent_name=>"David Crossley",
    :date=> Time,
    :opponent_id=>26809,
    :match_id=>1003302
  }
]
client.get_club_info(336) # retrieve club info for melbourne university #336
=> {
  :name=>"Melbourne University Squash Club",
  :players=>[
    {
      :name=>"David Clegg",
      :rating=>342.5,
      :rank=>0,
      :id=>43076
    }
  ],
  :juniors=>[
    {
      :name=>"Trevor Bryden",
      :rating=>95.28,
      :rank=>0,
      :id=>72728
    }
  ]
}
client.get_search_results("joshua") # search results for 'joshua'
=> {
  :players=>[
    {
      :name=>"Joshua Altmann",
      :club_name=>"Monash University",
      :id=>47508,
      :rating=>107.821
    }
  ],
  :teams=>[
    {
      :name=>"Joshua mallison",
      :division_name=>"Box 08",
      :event_name=>"2017 Briars @ Thornleigh Box Challenge (Season 29)",
      :id=>80792
    }
  ],
  :clubs=>[]
}
client.get_search_results("melbourne") # search results for 'melbourne'
=> {
  :players=>[
    {
      :name=>"Melbourne Simpson",
      :club_name=>"Mirrabooka",
      :id=>17797,
      :rating=>199.607
    }
  ],
  :teams=>[
    {
      :name=>"Melbourne Uni (2)@Fitz",
      :division_name=>"C Reserve",
      :event_name=>"2012 Melbourne Spring SSL Women's Pennant",
      :id=>39605
    }
  ],
  :clubs=>[
    {
      :name=>"Melbourne University",
      :state=>"Victoria",
      :id=>336
    }
  ]
}
# saving authentication state or using multiple clients
p = client.get_save_params
p => {
  :player=>42547,
  :password=>"Foo",
  :suppress_errors=>false,  
  :user_agent=>"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101213 Opera/9.80 (Windows NT 6.1; U; zh-tw) Presto/2.7.62 Version/11.01",
  :cookie=>".ASPXAUTH=CDA48BC54FCEB4F164D6AC464EFB3414866040FF085915F32BA18EFD5CF995DC59889B5E2124567CBE1B53DE66D6318E6510C5B884EAB5216457092AC079999C3E63BDDA45C94CCA1CD82E485A30D698BA426F4AA9C94301125966DB5D05FD4D; ASP.NET_SessionId=tx02u3xp51js1s3mgwwxhgq1; GroupId=0",
  :expires=>"2018-08-25 17:05:04 UTC"
}
replica_client = SquashMatrix::Client.new(p)
=> SquashMatrix::Client

If enabling squash players and clubs motivates you, please reach out and contribute on GitHub


The motivation for providing a ruby SDK is to map and provide current data for clubs/players/developers through an API layer at squashmatrix.io, stay posted for a product update, eta 4th quarter 2018

Show Comments