| Line 30... |
Line 30... |
| 30 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
30 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
| 31 |
'Accept-Language' : 'en-US,en;q=0.8',
|
31 |
'Accept-Language' : 'en-US,en;q=0.8',
|
| 32 |
'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
|
32 |
'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
|
| 33 |
}
|
33 |
}
|
| 34 |
|
34 |
|
| 35 |
ignoreItems = []
|
35 |
ignoreItems = [22804,22805,23462]
|
| 36 |
|
36 |
|
| 37 |
def get_mongo_connection(port=27017):
|
37 |
def get_mongo_connection(port=27017):
|
| 38 |
global con
|
38 |
global con
|
| 39 |
if con is None:
|
39 |
if con is None:
|
| 40 |
print "Establishing connection %s host and port %d" %(host,port)
|
40 |
print "Establishing connection %s host and port %d" %(host,port)
|
| Line 148... |
Line 148... |
| 148 |
elif source_id ==3:
|
148 |
elif source_id ==3:
|
| 149 |
try:
|
149 |
try:
|
| 150 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
150 |
if data['identifier'] is None or len(data['identifier'].strip())==0:
|
| 151 |
return {}
|
151 |
return {}
|
| 152 |
|
152 |
|
| - |
|
153 |
if data['_id'] in ignoreItems:
|
| - |
|
154 |
print "Ignored items returning for %d"%(data['_id'])
|
| - |
|
155 |
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'],'coupon':data['coupon'], 'codAvailable':data['codAvailable'], 'tagline': data['tagline'], 'offer': data['offer']}
|
| - |
|
156 |
|
| 153 |
try:
|
157 |
try:
|
| 154 |
if ignoreLastUpdated and data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
158 |
if ignoreLastUpdated and data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
|
| 155 |
print "sku id is already updated",data['_id']
|
159 |
print "sku id is already updated",data['_id']
|
| 156 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':3,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail'],'coupon':data['coupon'], 'codAvailable':data['codAvailable'],'tagline': data['tagline'], 'offer': data['offer']}
|
160 |
return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':3,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail'],'coupon':data['coupon'], 'codAvailable':data['codAvailable'],'tagline': data['tagline'], 'offer': data['offer']}
|
| 157 |
|
161 |
|