| Line 23... |
Line 23... |
| 23 |
|
23 |
|
| 24 |
(options, args) = parser.parse_args()
|
24 |
(options, args) = parser.parse_args()
|
| 25 |
|
25 |
|
| 26 |
mc = MemCache(options.mongoHost)
|
26 |
mc = MemCache(options.mongoHost)
|
| 27 |
|
27 |
|
| 28 |
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5}
|
28 |
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6}
|
| 29 |
|
29 |
|
| 30 |
headers = {
|
30 |
headers = {
|
| 31 |
'User-agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11',
|
31 |
'User-agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11',
|
| 32 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
32 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
| 33 |
'Accept-Language' : 'en-US,en;q=0.8',
|
33 |
'Accept-Language' : 'en-US,en;q=0.8',
|
| Line 237... |
Line 237... |
| 237 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
|
237 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
|
| 238 |
continue
|
238 |
continue
|
| 239 |
if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
|
239 |
if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
|
| 240 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
|
240 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
|
| 241 |
continue
|
241 |
continue
|
| - |
|
242 |
if similarItem['source_id'] == SOURCE_MAP.get('PAYTM.COM'):
|
| - |
|
243 |
similarItem['available_price'] = similarItem['gross_price']
|
| 242 |
if similarItem['available_price'] < prepaidBestPrice:
|
244 |
if similarItem['available_price'] < prepaidBestPrice:
|
| 243 |
prepaidBestOne = similarItem
|
245 |
prepaidBestOne = similarItem
|
| 244 |
prepaidBestPrice = similarItem['available_price']
|
246 |
prepaidBestPrice = similarItem['available_price']
|
| 245 |
prepaidBestSellerPoints = similarItem['bestSellerPoints']
|
247 |
prepaidBestSellerPoints = similarItem['bestSellerPoints']
|
| 246 |
elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
|
248 |
elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
|