1 October 2011

Parsing lotto Results

I've decided to set up another eclipse project so that I can write the component for pulling the lotto results from the lotto website and get the formatting right and then swap it in to the android app at a later point. Hopefully the only thing I'll have to swap around is some of code for setting up the connection and maybe some of the error handling.

I'm now using a different results page which I believe is formatted in a way which should make it easier to grab all of the results at once. So far the code sets up a connection to the lotto web server and reads line by line each page, looking for a specific piece of html, at which point functions are called to parse each set of results from that line down. It's worked pretty well so far. I'm just messing about with the formatting of the text at the minute cleaning it up a little. So far it looks like the following.

Wednesday 28 September 2011
Result: 5 10 15 27 35 43 Bonus: l
Plus 1 Draw: 17 19 25 30 41 44 Bonus: 42
Plus 2 Draw: 12 15 32 35 41 44 Bonus: 24


It's having trouble with some of dates because of the way I've written how it looks for that segment of code, but it's not important for the minute. I'll come back to it.

No comments:

Post a Comment