| Line 66... |
Line 66... |
| 66 |
data = fetchResponseUsingProxy(mobileCategoryUrl%(i))
|
66 |
data = fetchResponseUsingProxy(mobileCategoryUrl%(i))
|
| 67 |
jsonResponse = json.loads(data)
|
67 |
jsonResponse = json.loads(data)
|
| 68 |
for jsonProduct in jsonResponse['grid_layout']:
|
68 |
for jsonProduct in jsonResponse['grid_layout']:
|
| 69 |
rank = rank + 1
|
69 |
rank = rank + 1
|
| 70 |
identifier = jsonProduct["url"].split("?")[0].split("/")[-1]
|
70 |
identifier = jsonProduct["url"].split("?")[0].split("/")[-1]
|
| 71 |
r_info = __RankInfo(identifier,rank, None)
|
71 |
r_info = __RankInfo(identifier,rank, None, None,None,None,None,None,None,None,None)
|
| 72 |
print rank, identifier
|
72 |
print rank, identifier
|
| 73 |
bestSellers.append(r_info)
|
73 |
bestSellers.append(r_info)
|
| 74 |
|
74 |
|
| 75 |
|
75 |
|
| 76 |
def commitBestSellers(category):
|
76 |
def commitBestSellers(category):
|
| Line 101... |
Line 101... |
| 101 |
data = fetchResponseUsingProxy(bestSellerTabletsUrl%(i))
|
101 |
data = fetchResponseUsingProxy(bestSellerTabletsUrl%(i))
|
| 102 |
jsonResponse = json.loads(data)
|
102 |
jsonResponse = json.loads(data)
|
| 103 |
for jsonProduct in jsonResponse['grid_layout']:
|
103 |
for jsonProduct in jsonResponse['grid_layout']:
|
| 104 |
rank = rank + 1
|
104 |
rank = rank + 1
|
| 105 |
identifier = jsonProduct["url"].split("?")[0].split("/")[-1]
|
105 |
identifier = jsonProduct["url"].split("?")[0].split("/")[-1]
|
| 106 |
r_info = __RankInfo(identifier,rank, None)
|
106 |
r_info = __RankInfo(identifier,rank, None, None,None,None,None,None,None,None,None)
|
| 107 |
print rank, identifier
|
107 |
print rank, identifier
|
| 108 |
bestSellers.append(r_info)
|
108 |
bestSellers.append(r_info)
|
| 109 |
|
109 |
|
| 110 |
def resetRanks(category_id):
|
110 |
def resetRanks(category_id):
|
| 111 |
get_mongo_connection().Catalog.MasterData.update({'rank':{'$gt':0},'source_id':6,'category_id':category_id}, {'$set':{'rank':0}}, upsert=False, multi=True)
|
111 |
get_mongo_connection().Catalog.MasterData.update({'rank':{'$gt':0},'source_id':6,'category_id':category_id}, {'$set':{'rank':0}}, upsert=False, multi=True)
|