Subversion Repositories SmartDukaan

Rev

Rev 12437 | Rev 12440 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12437 Rev 12438
Line 99... Line 99...
99
        spString = "<dom>" + spString + "</dom>"
99
        spString = "<dom>" + spString + "</dom>"
100
        dom = parseString(spString)
100
        dom = parseString(spString)
101
        skuOffers = dom.getElementsByTagName('GetMyPriceForSKUResult')
101
        skuOffers = dom.getElementsByTagName('GetMyPriceForSKUResult')
102
        skuMap = {}
102
        skuMap = {}
103
        for skuOffer in skuOffers:
103
        for skuOffer in skuOffers:
-
 
104
            try:
104
            status = skuOffer.attributes.items()[0][1]
105
                status = skuOffer.attributes.items()[0][1]
105
            sku = skuOffer.attributes.items()[1][1]
106
                sku = skuOffer.attributes.items()[1][1]
106
            print "fetching details of ",sku
-
 
107
            asin = skuOffer.getElementsByTagName('ASIN')[0].firstChild.nodeValue
107
                asin = skuOffer.getElementsByTagName('ASIN')[0].firstChild.nodeValue
-
 
108
            except:
-
 
109
                continue
108
            for offer in skuOffer.getElementsByTagName('Offers'):
110
            for offer in skuOffer.getElementsByTagName('Offers'):
109
                temp = {}
111
                temp = {}
110
                try:
112
                try:
111
                    promoPrice = offer.getElementsByTagName('LandedPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
113
                    promoPrice = offer.getElementsByTagName('LandedPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
112
                    regularPrice = offer.getElementsByTagName('RegularPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
114
                    regularPrice = offer.getElementsByTagName('RegularPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
Line 162... Line 164...
162
        return self.make_request(data,'GetLowestOfferListingsForSKU')
164
        return self.make_request(data,'GetLowestOfferListingsForSKU')
163
    
165
    
164
def main():
166
def main():
165
    p = Products("AKIAII3SGRXBJDPCHSGQ", "B92xTbNBTYygbGs98w01nFQUhbec1pNCkCsKVfpg", "AF6E3O0VE0X4D")
167
    p = Products("AKIAII3SGRXBJDPCHSGQ", "B92xTbNBTYygbGs98w01nFQUhbec1pNCkCsKVfpg", "AF6E3O0VE0X4D")
166
    comp = p.get_competitive_pricing_for_sku('A21TJRUUN4KGV', ['FBA11707'])
168
    comp = p.get_competitive_pricing_for_sku('A21TJRUUN4KGV', ['FBA11707'])
167
    our = p.get_my_pricing_for_sku('A21TJRUUN4KGV', ['FBA11707'])
169
    our = p.get_my_pricing_for_sku('A21TJRUUN4KGV', ['FBA11739'])
168
    print comp
170
    print comp
169
    print our
171
    print our
170
#    print comp.get('FBA12248')
172
#    print comp.get('FBA12248')
171
#    print our.get('FBA12248')
173
#    print our.get('FBA12248')
172
#    x = (our.get('FBA12248'))
174
#    x = (our.get('FBA12248'))