| Line 29... |
Line 29... |
| 29 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
29 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
| 30 |
'Accept-Language' : 'en-US,en;q=0.8',
|
30 |
'Accept-Language' : 'en-US,en;q=0.8',
|
| 31 |
'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
|
31 |
'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
|
| 32 |
}
|
32 |
}
|
| 33 |
|
33 |
|
| - |
|
34 |
ignoreItems = [4490,4491]
|
| - |
|
35 |
|
| 34 |
def get_mongo_connection(port=27017):
|
36 |
def get_mongo_connection(port=27017):
|
| 35 |
global con
|
37 |
global con
|
| 36 |
if con is None:
|
38 |
if con is None:
|
| 37 |
print "Establishing connection %s host and port %d" %(host,port)
|
39 |
print "Establishing connection %s host and port %d" %(host,port)
|
| 38 |
try:
|
40 |
try:
|
| Line 206... |
Line 208... |
| 206 |
elif source_id == 2:
|
208 |
elif source_id == 2:
|
| 207 |
try:
|
209 |
try:
|
| 208 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
210 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
| 209 |
return {}
|
211 |
return {}
|
| 210 |
|
212 |
|
| - |
|
213 |
if data['_id'] in ignoreLastUpdated:
|
| - |
|
214 |
print "Ignored items returning for %d"%(data['_id'])
|
| - |
|
215 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':1,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
| - |
|
216 |
|
| 211 |
try:
|
217 |
try:
|
| 212 |
if ignoreLastUpdated and data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
218 |
if ignoreLastUpdated and data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
| 213 |
print "sku id is already updated",data['_id']
|
219 |
print "sku id is already updated",data['_id']
|
| 214 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':2,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
220 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':2,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
|
| 215 |
except:
|
221 |
except:
|