Skip to content

Commit

Permalink
Merge pull request #2 from ImmyR/master
Browse files Browse the repository at this point in the history
final thingy updated
  • Loading branch information
ImmyR committed Aug 8, 2013
2 parents fb157ca + 7e8132e commit b260dcc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions everything.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import json
import urllib.request
import cgitb
import sys
import cgi
cgitb.enable()


print("Content-Type: application/json")
print()

fields = cgi.FieldStorage()
if "term" not in fields:
print("[]")
sys.exit()

f = urllib.request.urlopen('http://gtr.rcuk.ac.uk/search/project.json?term=mouse')
f = urllib.request.urlopen('http://gtr.rcuk.ac.uk/search/project.json?term=%s' % (fields['term']))
s = f.read()
data = json.loads(s.decode('utf-8'))
f.close()
Expand Down Expand Up @@ -41,8 +48,6 @@

organisations[orgid].append(details)

# print "%s gave %d pounds to %s for '%s'\n" % (funder, pounds, fundee, title)

results = list()

for organisation in organisations.keys():
Expand Down

0 comments on commit b260dcc

Please sign in to comment.