geekahedron / SteamGameAutoJoin

AutoJoin script for game lobby page of 2015 Steam Summer Minigame
16 stars 16 forks source link

Idea on how to fetch the room numbers of steamga.me, MSG15, CMP2015, YOWH, etc #1

Closed Dreamcooled closed 9 years ago

Dreamcooled commented 9 years ago

Since all cross-domain requests are blocked you need to do some tricks. If you dont want to write a chrome plugin you have to bypass the cross-domain limitation e.g. by using the following trick: Insert an image in the DOM:

jQuery("body").append("<img src='http://example.com/room_nr_1.png' id='bla'>");

and later query it's width and height to get the room info out of it

  var roomid = jQuery("#bla").height() * jQuery("#bla").width()

Of course you would have to make multiple requests (each with a new image):

using that technology you should be able to request at least the roomnbrs (not the names).

You can host the webserver directly on github, using https://pages.github.com/