Subversion Repositories SmartDukaan

Rev

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

Rev 14205 Rev 14206
Line 87... Line 87...
87
            response = urllib2.urlopen(req)
87
            response = urllib2.urlopen(req)
88
            print response.read()
88
            print response.read()
89
            response.close()
89
            response.close()
90
            json_input = response.read()
90
            json_input = response.read()
91
            priceInfo = json.loads(json_input)
91
            priceInfo = json.loads(json_input)
-
 
92
            print priceInfo
92
            lowestPrice = priceInfo['response']['sellingPrice']
93
            lowestPrice = priceInfo['response']['sellingPrice']
93
            print "*****"
94
            print "*****"
94
            print lowestPrice
95
            print lowestPrice
95
            print instock
96
            print instock
96
            if lowestPrice > 0:
97
            if lowestPrice > 0:
Line 107... Line 108...
107
                recomputeDeal(data['skuBundleId'])
108
                recomputeDeal(data['skuBundleId'])
108
            except:
109
            except:
109
                print "Unable to compute deal for ",data['skuBundleId']
110
                print "Unable to compute deal for ",data['skuBundleId']
110
                
111
                
111
            return {'_id':data['_id'],'available_price':lowestPrice,'in_stock':inStock,'source_id':4,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
112
            return {'_id':data['_id'],'available_price':lowestPrice,'in_stock':inStock,'source_id':4,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
-
 
113
        except Exception as e:
112
        except:
114
            print e
113
            return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':4,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
115
            return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':4,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
114
        
116
        
115
            
117
            
116
            
118
            
117
            
119