Subversion Repositories SmartDukaan

Rev

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

Rev 12436 Rev 12437
Line 101... Line 101...
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
            status = skuOffer.attributes.items()[0][1]
104
            status = skuOffer.attributes.items()[0][1]
105
            sku = skuOffer.attributes.items()[1][1]
105
            sku = skuOffer.attributes.items()[1][1]
106
            asin = skuOffer.getElementsByTagName('ASIN')[0].firstChild.nodeValue
-
 
107
            print "fetching details of ",sku
106
            print "fetching details of ",sku
-
 
107
            asin = skuOffer.getElementsByTagName('ASIN')[0].firstChild.nodeValue
108
            for offer in skuOffer.getElementsByTagName('Offers'):
108
            for offer in skuOffer.getElementsByTagName('Offers'):
109
                temp = {}
109
                temp = {}
110
                try:
110
                try:
111
                    promoPrice = offer.getElementsByTagName('LandedPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
111
                    promoPrice = offer.getElementsByTagName('LandedPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
112
                    regularPrice = offer.getElementsByTagName('RegularPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
112
                    regularPrice = offer.getElementsByTagName('RegularPrice')[0].getElementsByTagName('Amount')[0].firstChild.nodeValue
Line 161... Line 161...
161
            num+=1
161
            num+=1
162
        return self.make_request(data,'GetLowestOfferListingsForSKU')
162
        return self.make_request(data,'GetLowestOfferListingsForSKU')
163
    
163
    
164
def main():
164
def main():
165
    p = Products("AKIAII3SGRXBJDPCHSGQ", "B92xTbNBTYygbGs98w01nFQUhbec1pNCkCsKVfpg", "AF6E3O0VE0X4D")
165
    p = Products("AKIAII3SGRXBJDPCHSGQ", "B92xTbNBTYygbGs98w01nFQUhbec1pNCkCsKVfpg", "AF6E3O0VE0X4D")
166
    comp = p.get_competitive_pricing_for_sku('A21TJRUUN4KGV', ['FBA10049'])
166
    comp = p.get_competitive_pricing_for_sku('A21TJRUUN4KGV', ['FBA11707'])
167
    our = p.get_my_pricing_for_sku('A21TJRUUN4KGV', ['FBA10049'])
167
    our = p.get_my_pricing_for_sku('A21TJRUUN4KGV', ['FBA11707'])
168
    print comp
168
    print comp
169
    print our
169
    print our
170
#    print comp.get('FBA12248')
170
#    print comp.get('FBA12248')
171
#    print our.get('FBA12248')
171
#    print our.get('FBA12248')
172
#    x = (our.get('FBA12248'))
172
#    x = (our.get('FBA12248'))