PanoRaMa   United States. Oct 11 2014 05:14. Posts 1655
Nice. How does the scraper work, is it visual based on the hole card? I assume this game doesn't come with a friendly API or anything
http://panorama.liquidpoker.net
1
Rinny   United States. Oct 11 2014 12:28. Posts 600
On October 11 2014 04:14 PanoRaMa wrote:
Nice. How does the scraper work, is it visual based on the hole card? I assume this game doesn't come with a friendly API or anything
At first I tried taking a screen shot of the game then using OCR to read the cards, but it didn't work reliably. It's an HTML5 game, and nothing has been done to obfuscate the HTML, so there are elements that look like this <span class="player-card 5-h"> that represent different cards. That lets me use javascript to grab all that info, then format it in a way that makes it easier for me to control the AI.
1
Silver_nz   New Zealand. Oct 11 2014 18:41. Posts 5647
pretty awesome. does your bot crush the facedonk games?
1
PanoRaMa   United States. Oct 11 2014 19:09. Posts 1655
On October 11 2014 04:14 PanoRaMa wrote:
Nice. How does the scraper work, is it visual based on the hole card? I assume this game doesn't come with a friendly API or anything
At first I tried taking a screen shot of the game then using OCR to read the cards, but it didn't work reliably. It's an HTML5 game, and nothing has been done to obfuscate the HTML, so there are elements that look like this <span class="player-card 5-h"> that represent different cards. That lets me use javascript to grab all that info, then format it in a way that makes it easier for me to control the AI.
Oh ok. You probably know this but I'd be careful about the dependency on the DOM. I built a scrape-based tool a while ago that got screwed when the vendor site changed its DOM completely
On October 11 2014 04:14 PanoRaMa wrote:
Nice. How does the scraper work, is it visual based on the hole card? I assume this game doesn't come with a friendly API or anything
At first I tried taking a screen shot of the game then using OCR to read the cards, but it didn't work reliably. It's an HTML5 game, and nothing has been done to obfuscate the HTML, so there are elements that look like this <span class="player-card 5-h"> that represent different cards. That lets me use javascript to grab all that info, then format it in a way that makes it easier for me to control the AI.
Oh ok. You probably know this but I'd be careful about the dependency on the DOM. I built a scrape-based tool a while ago that got screwed when the vendor site changed its DOM completely
That's kinda what he has to do though, unless he wrote another client to just directly talk to the server by sending AJAX's lol
and even then, API could change on you
no pain no gain
Last edit: 11/10/2014 22:04
1
Rinny   United States. Oct 12 2014 13:43. Posts 600
On October 11 2014 21:03 lhr0909 wrote:
FTFY buddy
Thanks, I couldn't figure out why mine wasn't embedding. Thankfully the model of the game is pretty simple, so if they change the dom, it should be easy to swap out the selectors for the stuff I need.