import urllib2
import simplejson
import unicodecsv

req = urllib2.Request("https://2014.foss4g.org/map-gallery/map-gallery-feed")
opener = urllib2.build_opener()
f = opener.open(req)
j = simplejson.load(f)

maps = [['ID','Title','Best open source software integration','Best open source data integration','Best static map (digital display)','Best web map application','Best overall cartographic display','Best anti-map map','Most unique map','Comments']]                 
for rec in j:
    soft = ""
    data = ""
    web = ""
    static = ""

    if "Open Source software integration" in rec['category']:
        soft = 'x'
    if "Open Source data integration" in rec['category']:
        data = 'x'
    if "Web Map Application" in rec['category']:
        web = 'x'
    if "Static Map" in rec['category']:
        static = 'x'
                    
    maps.append([rec['id'],rec['title'],soft,data,web,static])

for map in maps: print map

with open('mapgallery.csv', 'wb') as f:
    writer = unicodecsv.writer(f)
    writer.writerows(maps)
@@ -707,27 +707,18 @@
 if %22
-Web Map Application
+Static Map
 %22 in
@@ -743,19 +743,22 @@
         
-web
+static
  = 'x'%0A 
@@ -760,34 +760,43 @@
 'x'%0A    if %22
-Static Map
+Web Map Application
 %22 in rec%5B'ca
@@ -805,38 +805,35 @@
 gory'%5D:%0A        
-static
+web
  = 'x'%0A         
@@ -898,18 +898,18 @@
 ata,
-web,
 static
+,web
 %5D)%0A%0A

fix bug where static and web mixed