# HG changeset patch # User dwinter # Date 1355510861 18000 # Node ID ceac1f8e896f2556c3f457e424159e6950b8f004 # Parent 3532f1c49efb8498bf03ad3e455fe36bbf9bdc0c exportTexts diff -r 3532f1c49efb -r ceac1f8e896f .pydevproject --- a/.pydevproject Thu Dec 13 19:29:05 2012 -0500 +++ b/.pydevproject Fri Dec 14 13:47:41 2012 -0500 @@ -2,6 +2,6 @@ -python2.7_zope +Default python 2.7 diff -r 3532f1c49efb -r ceac1f8e896f exportTextToSolr.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exportTextToSolr.py Fri Dec 14 13:47:41 2012 -0500 @@ -0,0 +1,20 @@ +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() \ No newline at end of file