Subversion Repositories SmartDukaan

Rev

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

Rev 16505 Rev 16869
Line 24... Line 24...
24
                   default="False", type="string",
24
                   default="False", type="string",
25
                   help="Reset Ranks?")
25
                   help="Reset Ranks?")
26
 
26
 
27
(options, args) = parser.parse_args()
27
(options, args) = parser.parse_args()
28
 
28
 
29
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5}
29
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6}
30
bestSellers = []
30
bestSellers = []
31
baseUrl = "http://m.shopclues.com/products/getProductList/mobiles:top-selling-mobiles-and-tablets.html/%s/page=%s"
31
baseUrl = "http://m.shopclues.com/products/getProductList/mobiles:top-selling-mobiles-and-tablets.html/%s/page=%s"
32
headers = {
32
headers = {
33
            'User-Agent':'Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36',
33
            'User-Agent':'Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36',
34
            'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',      
34
            'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',      
Line 234... Line 234...
234
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
234
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
235
                continue
235
                continue
236
            if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
236
            if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
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('PAYTM.COM'):
-
 
240
                similarItem['available_price'] = similarItem['gross_price']
239
            if similarItem['available_price'] < prepaidBestPrice:
241
            if similarItem['available_price'] < prepaidBestPrice:
240
                prepaidBestOne = similarItem
242
                prepaidBestOne = similarItem
241
                prepaidBestPrice = similarItem['available_price']
243
                prepaidBestPrice = similarItem['available_price']
242
                prepaidBestSellerPoints = similarItem['bestSellerPoints']
244
                prepaidBestSellerPoints = similarItem['bestSellerPoints']
243
            elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
245
            elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']: