Skip to content

Instantly share code, notes, and snippets.

@wkalt
Created August 8, 2014 15:22
Show Gist options
  • Save wkalt/1217275edc63054cc880 to your computer and use it in GitHub Desktop.
Save wkalt/1217275edc63054cc880 to your computer and use it in GitHub Desktop.
import urllib2
import urllib
import json
query = '["or",\
["and", ["=", "type", "Class"], ["=", "title", "Php"]],\
["and", ["=", "type", "Class"], ["=", "title", "Nginx"]]]'
url = 'http://localhost:8080/v4/resources?%s' % urllib.urlencode({'query': query})
data = json.loads(urllib2.urlopen(url).read())
print(set(x["certname"] for x in data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment