Created
May 14, 2012 15:27
-
-
Save ralphbean/2694573 to your computer and use it in GitHub Desktop.
An example of searching for packages against the new fedora-packages app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import pprint | |
| import json | |
| import urllib | |
| BASE_URL = "https://apps.fedoraproject.org/packages/" + \ | |
| "fcomm_connector/xapian/query/search_packages/" | |
| query_params = { | |
| "filters": {"search": "awesome"}, | |
| "rows_per_page": 10, | |
| "start_row": 0, | |
| } | |
| query_as_json = json.dumps(query_params) | |
| URL = BASE_URL + query_as_json | |
| response_as_json = urllib.urlopen(URL).read() | |
| response = json.loads(response_as_json) | |
| pprint.pprint(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment