Mercurial > hg > ISMI_JSONClient
view exportTextToSolr.py @ 4:ceac1f8e896f default tip
exportTexts
author | dwinter |
---|---|
date | Fri, 14 Dec 2012 13:47:41 -0500 |
parents | |
children |
line wrap: on
line source
import json import urllib2 u = urllib2.urlopen('https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/jsonInterface?method=get_ents&oc=TEXT') texts= json.load(u) for ent in texts['ents']: id= ent['id'] x = urllib2.urlopen('http://localhost:58180/ISMI/database/text.xml?id='+repr(id)) fw=file("/tmp/"+repr(id)+".xml",'w') print id fw.write(x.read()) fw.close() x.close() u.close()