| Line 36... |
Line 36... |
| 36 |
try:
|
36 |
try:
|
| 37 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
37 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
| 38 |
return {}
|
38 |
return {}
|
| 39 |
|
39 |
|
| 40 |
try:
|
40 |
try:
|
| 41 |
if data['updatedOn'] + timedelta(minutes=5) > to_java_date(now):
|
41 |
if data['updatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
| 42 |
print "sku id is already updated",data['_id']
|
42 |
print "sku id is already updated",data['_id']
|
| 43 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':1,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
43 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':1,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
| 44 |
except:
|
44 |
except:
|
| 45 |
pass
|
45 |
pass
|
| 46 |
|
46 |
|
| Line 71... |
Line 71... |
| 71 |
try:
|
71 |
try:
|
| 72 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
72 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
| 73 |
return {}
|
73 |
return {}
|
| 74 |
|
74 |
|
| 75 |
try:
|
75 |
try:
|
| 76 |
if data['updatedOn'] + timedelta(minutes=5) > to_java_date(now):
|
76 |
if data['updatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
| 77 |
print "sku id is already updated",data['_id']
|
77 |
print "sku id is already updated",data['_id']
|
| 78 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':3,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
78 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':3,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
| 79 |
except:
|
79 |
|
| - |
|
80 |
except Exception as e:
|
| - |
|
81 |
print e
|
| 80 |
pass
|
82 |
pass
|
| 81 |
|
83 |
|
| 82 |
|
84 |
|
| 83 |
url="http://www.snapdeal.com/acors/json/gvbps?supc=%s&catId=175&sort=sellingPrice"%(data['identifier'])
|
85 |
url="http://www.snapdeal.com/acors/json/gvbps?supc=%s&catId=175&sort=sellingPrice"%(data['identifier'])
|
| 84 |
req = urllib2.Request(url,headers=headers)
|
86 |
req = urllib2.Request(url,headers=headers)
|
| Line 117... |
Line 119... |
| 117 |
try:
|
119 |
try:
|
| 118 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
120 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
| 119 |
return {}
|
121 |
return {}
|
| 120 |
|
122 |
|
| 121 |
try:
|
123 |
try:
|
| 122 |
if data['updatedOn'] + timedelta(minutes=5) > to_java_date(now):
|
124 |
if data['updatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
| 123 |
print "sku id is already updated",data['_id']
|
125 |
print "sku id is already updated",data['_id']
|
| 124 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':2,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
126 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['inStock'],'source_id':2,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
| 125 |
except:
|
127 |
except:
|
| 126 |
pass
|
128 |
pass
|
| 127 |
|
129 |
|