#!/usr/bin/env python # # Copyright 2012, 2013 Nick Galbreath # nickg@client9.com # BSD License -- see COPYING.txt for details # """ Converts a libinjection JSON data file to PHP array """ def toc(obj): """ main routine """ print """ '{1}',".format(k, words[k]) print ');\n' keywords = obj['fingerprints'] print '$fingerprints = array(' for k in sorted(keywords): print "'{0}',".format(k.upper()) print ');' return 0 if __name__ == '__main__': import sys import json sys.exit(toc(json.load(sys.stdin)))