]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Anonymize IPs in survey data postproc
authorMichael Hanke <michael.hanke@gmail.com>
Mon, 13 Jun 2011 15:05:01 +0000 (11:05 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Mon, 13 Jun 2011 15:05:01 +0000 (11:05 -0400)
survey/postprocdata

index abd834f6369a2ad36823d9f5be76179f1b0ac434..015e6b9d371b393af285073f009c06e11f4808ae 100755 (executable)
@@ -149,6 +149,8 @@ for f in infiles:
             for v in values:
                 unhandled[v] = unhandled.get(v, 0) + 1
     verbose(3, "Storing file %s" % fname)
+    # shorten IP
+    j['remote_addr'] = '.'.join(j['remote_addr'].split('.')[:2]) + '.x.x'
     json.dump(j, open(os.path.join(dataout, fname), 'w'), indent=2)
     #open(os.path.join(dataout, fname), 'w').write(json.write(j))