- Google Goggles API
- Sudoku Wizard - a Google Goggles Experiment
So you ask, "what did you exactly build?" I remember back in January when Goggles 1.3 was announced, Google demoed a nifty new feature in Goggles, which recognizes a Sudoku puzzle when provided a picture of one and solves it for you. I was really intrigued with the service since, and that's what drove me to reverse engineer the protocol. So back to the question, I wrote a Sudoku solver Windows Phone 7 application that does just that. You might also ask, "why Windows Phone 7?" Well, it's simple really. Google Goggles is available on iOS and Android platforms - it wouldn't make much sense to build another app targeting those platforms.
If you happen to have a WP7 in your possession, check out the "Sudoku Wizard" app here. Did I mention it's free (yes, Ad-free too).
Sudoku Wizard was written using the information from my previous post. In my previous post, I said that there are two headers that need to be added to all HTTP communication with Goggles. There is another header required for this to work. I needed to modify the user-agent as well. Apparently, Goggles requires an iOS/Android device (or perhaps a WebKit browser) in order to solve your Sudoku puzzle - and that's easily taken care of by modifying the user-agent of each HTTP request. I omitted it from my instructions in my previous post because I had thought it was insignificant. So the only thing different that I needed to do was to change the user-agent in all of the HTTP POST requests. The headers now look like:
httpWebRequest.UserAgent = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like " + "Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 " + "Safari/528.16 GoogleMobileApp/0.7.3.5675 GoogleGoggles-iPhone/1.0; gzip"
When posting an image of a Sudoku, Goggles will respond with a protobuffer blob with some URLs in it. Goggles solves the Sudoku and returns the solution in a URL, which needs to be displayed in a browser. An example of a response is shown below. The highlighted URL is the one that contains the solution and needs to be shown to the user (keep in mind that the URLs will be expired by the time you have viewed them):