Subversion Repositories SmartDukaan

Rev

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

Rev 14208 Rev 14210
Line 83... Line 83...
83
        url = "http://109.74.200.220:8080/mobileapi/dtr-pricing?id=%s"%(data['identifier'])
83
        url = "http://109.74.200.220:8080/mobileapi/dtr-pricing?id=%s"%(data['identifier'])
84
        lowestPrice = 0.0
84
        lowestPrice = 0.0
85
        instock = 0
85
        instock = 0
86
        req = urllib2.Request(url,headers=headers)
86
        req = urllib2.Request(url,headers=headers)
87
        response = urllib2.urlopen(req)
87
        response = urllib2.urlopen(req)
88
        response.close()
-
 
89
        json_input = response.read()
88
        json_input = response.read()
-
 
89
        response.close()
90
        print "response"
90
        print "response"
91
        print json_input
91
        print json_input
92
        priceInfo = json.loads(json_input)
92
        priceInfo = json.loads(json_input)
93
        print priceInfo
93
        print priceInfo
94
        lowestPrice = priceInfo['response']['sellingPrice']
94
        lowestPrice = priceInfo['response']['sellingPrice']
Line 129... Line 129...
129
            
129
            
130
            
130
            
131
            url="http://www.snapdeal.com/acors/json/gvbps?supc=%s&catId=175&sort=sellingPrice"%(data['identifier'])
131
            url="http://www.snapdeal.com/acors/json/gvbps?supc=%s&catId=175&sort=sellingPrice"%(data['identifier'])
132
            req = urllib2.Request(url,headers=headers)
132
            req = urllib2.Request(url,headers=headers)
133
            response = urllib2.urlopen(req)
133
            response = urllib2.urlopen(req)
134
            response.close()
-
 
135
            json_input = response.read()
134
            json_input = response.read()
-
 
135
            response.close()
136
            vendorInfo = json.loads(json_input)
136
            vendorInfo = json.loads(json_input)
137
            lowestOfferPrice = 0
137
            lowestOfferPrice = 0
138
            inStock = 0
138
            inStock = 0
139
            for vendor in vendorInfo:
139
            for vendor in vendorInfo:
140
                lowestOfferPrice = float(vendor['sellingPrice'])
140
                lowestOfferPrice = float(vendor['sellingPrice'])