| Line 348... |
Line 348... |
| 348 |
<td style="text-align:center">"""+str(exceptionItem.coupon)+"""</td>
|
348 |
<td style="text-align:center">"""+str(exceptionItem.coupon)+"""</td>
|
| 349 |
<td style="text-align:left">"""+(exceptionItem.thumbnail)+"""</td>
|
349 |
<td style="text-align:left">"""+(exceptionItem.thumbnail)+"""</td>
|
| 350 |
</tr>"""
|
350 |
</tr>"""
|
| 351 |
message+="""</tbody></table></body></html>"""
|
351 |
message+="""</tbody></table></body></html>"""
|
| 352 |
print message
|
352 |
print message
|
| 353 |
recipients = ['kshitij.sood@saholic.com']
|
353 |
#recipients = ['kshitij.sood@saholic.com']
|
| 354 |
#recipients = ['rajneesh.arora@saholic.com','kshitij.sood@saholic.com','chaitnaya.vats@saholic.com','manoj.kumar@saholic.com']
|
354 |
recipients = ['rajneesh.arora@saholic.com','kshitij.sood@saholic.com','chaitnaya.vats@saholic.com','manoj.kumar@saholic.com']
|
| 355 |
msg = MIMEMultipart()
|
355 |
msg = MIMEMultipart()
|
| 356 |
msg['Subject'] = "Shopclues Best Sellers" + ' - ' + str(datetime.now())
|
356 |
msg['Subject'] = "Shopclues Best Sellers" + ' - ' + str(datetime.now())
|
| 357 |
msg['From'] = ""
|
357 |
msg['From'] = ""
|
| 358 |
msg['To'] = ",".join(recipients)
|
358 |
msg['To'] = ",".join(recipients)
|
| 359 |
msg.preamble = "Shopclues Best Sellers" + ' - ' + str(datetime.now())
|
359 |
msg.preamble = "Shopclues Best Sellers" + ' - ' + str(datetime.now())
|
| Line 373... |
Line 373... |
| 373 |
def resetRanks(category):
|
373 |
def resetRanks(category):
|
| 374 |
get_mongo_connection().Catalog.MasterData.update({'rank':{'$gt':0},'source_id':5},{'$set' : {'rank':0,'updatedOn':to_java_date(now)}}, multi=True)
|
374 |
get_mongo_connection().Catalog.MasterData.update({'rank':{'$gt':0},'source_id':5},{'$set' : {'rank':0,'updatedOn':to_java_date(now)}}, multi=True)
|
| 375 |
|
375 |
|
| 376 |
def main():
|
376 |
def main():
|
| 377 |
if options.reset == 'True':
|
377 |
if options.reset == 'True':
|
| - |
|
378 |
print "Resetting ranks"
|
| 378 |
resetRanks()
|
379 |
resetRanks()
|
| 379 |
scrapeBestSellers()
|
380 |
scrapeBestSellers()
|
| 380 |
if len(bundledProducts)>0 or len(exceptionList) > 0:
|
381 |
if len(bundledProducts)>0 or len(exceptionList) > 0:
|
| 381 |
sendMail()
|
382 |
sendMail()
|
| 382 |
|
383 |
|