<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://textserver.lsi.upc.edu/wiki/index.php?action=history&amp;feed=atom&amp;title=Batch_Results_Retrieval_in_Python3</id>
		<title>Batch Results Retrieval in Python3 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://textserver.lsi.upc.edu/wiki/index.php?action=history&amp;feed=atom&amp;title=Batch_Results_Retrieval_in_Python3"/>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python3&amp;action=history"/>
		<updated>2026-08-13T22:21:34Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python3&amp;diff=163&amp;oldid=prev</id>
		<title>Padro at 09:33, 24 August 2018</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python3&amp;diff=163&amp;oldid=prev"/>
				<updated>2018-08-24T09:33:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
tkid = raw_input('TextServer Job Token ID: ')&lt;br /&gt;
outfname = raw_input('Output ZIP file: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username' : user&lt;br /&gt;
                'tokenID' : tkid &lt;br /&gt;
               }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/resultRetrieve&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# no error, save results to output file&lt;br /&gt;
outf=open(outfname, 'w+')&lt;br /&gt;
print(resp, file=outf)&lt;br /&gt;
outf.close()&lt;br /&gt;
print &amp;quot;Job finished. Results saved to&amp;quot;,outfname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	</feed>