angry birds

Christian Harms's picture

How many angry birds defeat how many pigs in google+?

Coding (in spare time) should be fun. Some times I change this with real gaming like the angry birds on google+. But after some days of scoring agains my friends I opened the HttpFox plugin and looked behind the normal interface.

And I got a view of the JSON-data files from the angry birds game. Every level is offered in a single json-file and has count for the 1-, 2- or 3-star assessment. With some python scripting I fetched all level files from the app enginge instance of angry birds.

  1. import json, urllib
  2. for level in range(1,9):
  3.   for stage in range(1, level <6 and 22 or 16):
  4.     #url is shorted to prevent copy/paste kiddies ...
  5.     lvUrl = "https://r3138-dot-xxxx.appspot.com/cors/fowl/json/Level%d-%d.json" % (level, stage)
  6.     data = json.loads(urllib.urlopen(lvUrl).read())
  7.     print "You need %s points for 3 stars in level %d-%d." % (
  8.                data["scoreGold"], level, stage)

That's was so easy - all work was done.

And the answer to the question (for all 8 levels and the Chrome level):Read more

Syndicate content