Created
September 18, 2014 06:09
-
-
Save nickb-minted/65c2dd614396ed43b41a to your computer and use it in GitHub Desktop.
This file contains 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
import string | |
import urllib2 | |
def _main(): | |
f = open('duplicates', 'r') | |
for line in f: | |
xml = string.Template(XML_ORDER_STATUS).substitute( | |
prodID=line.strip()) | |
req = urllib2.Request('http://dpcsxml.cgx.com/PrintTalk/BTSHTTPReceive.dll', xml) | |
response = urllib2.urlopen(req) | |
print response.read() | |
XML_ORDER_STATUS = """<?xml version='1.0' encoding='utf-8'?> | |
<PrintTalk xmlns:schemaLocation="http://www.printtalk.org/schema/printTalk_1_1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" payloadID="2013-11-11T09:13:20Z" timeStamp="2013-11-11T09:13:20Z" version="1.1" xmlns="http://www.printtalk.org/schema"> | |
<Header> | |
<From> | |
<Credential domain="minted.com"> | |
<Identity>Minted</Identity> | |
</Credential> | |
</From> | |
<To> | |
<Credential domain="cgx-nies.com"> | |
<Identity>Minted</Identity> | |
</Credential> | |
</To> | |
<Sender> | |
<Credential domain="minted.com"> | |
<Identity>M1nt3d</Identity> | |
<SharedSecret>M1nt3dPa55</SharedSecret> | |
</Credential> | |
<UserAgent>Minted 1.0</UserAgent> | |
</Sender> | |
</Header> | |
<Request> | |
<OrderStatusRequest AgentDisplayName="Minted 1.3" AgentID="Minted" BusinessID="SINGLE" RequestDate="2013-11-11T09:13:02-07:00"> | |
<StatusRequest JobIDRef="PROD-$prodID" /> | |
</OrderStatusRequest> | |
</Request> | |
</PrintTalk>""" | |
if __name__ == '__main__': | |
_main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment