Subversion Repositories SmartDukaan

Rev

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

Rev 20357 Rev 20358
Line 71... Line 71...
71
            t_title = data['value']['titles']['title']
71
            t_title = data['value']['titles']['title']
72
            t_subtitle = data['value']['titles']['subtitle']
72
            t_subtitle = data['value']['titles']['subtitle']
73
            title = (xstr(t_title) + " " + xstr(t_subtitle)).strip()
73
            title = (xstr(t_title) + " " + xstr(t_subtitle)).strip()
74
            print title
74
            print title
75
            url =  (data['value']['smartUrl']).replace("http://dl.flipkart.com/dl", "http://www.flipkart.com")
75
            url =  (data['value']['smartUrl']).replace("http://dl.flipkart.com/dl", "http://www.flipkart.com")
-
 
76
            print url
-
 
77
            print identifier
-
 
78
            print "=================="
76
            r_info = __RankInfo(identifier, rank, 5, title, url)
79
            r_info = __RankInfo(identifier, rank, 5, title, url)
77
            bestSellers.append(r_info)
80
            bestSellers.append(r_info)
78
            rank = rank + 1
81
            rank = rank + 1
79
 
82
 
80
def commitBestSellers():
83
def commitBestSellers():
Line 109... Line 112...
109
        <td style="text-align:center">"""+(CATEGORY_MAP.get(item.category))+"""</td>
112
        <td style="text-align:center">"""+(CATEGORY_MAP.get(item.category))+"""</td>
110
        <td style="text-align:center">"""+str(item.rank)+"""</td>
113
        <td style="text-align:center">"""+str(item.rank)+"""</td>
111
        <td style="text-align:center">"""+(item.url)+"""</td>
114
        <td style="text-align:center">"""+(item.url)+"""</td>
112
        </tr>"""
115
        </tr>"""
113
    message+="""</tbody></table></body></html>"""
116
    message+="""</tbody></table></body></html>"""
114
    encoding =  chardet.detect(message)
-
 
115
    try:
-
 
116
        message = message.decode(encoding.get('encoding'))
117
    message = message.decode('ascii', 'ignore')
117
    except:
-
 
118
        message = message.decode(encoding.get('latin-1'))
-
 
119
    #recipients = ['kshitij.sood@saholic.com']
118
    #recipients = ['kshitij.sood@saholic.com']
120
    recipients = ['rajneesh.arora@saholic.com','kshitij.sood@saholic.com','chaitnaya.vats@saholic.com','ritesh.chauhan@saholic.com','khushal.bhatia@saholic.com']
119
    recipients = ['rajneesh.arora@saholic.com','kshitij.sood@saholic.com','chaitnaya.vats@saholic.com','ritesh.chauhan@saholic.com','khushal.bhatia@saholic.com']
121
    msg = MIMEMultipart()
120
    msg = MIMEMultipart()
122
    msg['Subject'] = "Flipkart Best Sellers" + ' - ' + str(datetime.now())
121
    msg['Subject'] = "Flipkart Best Sellers" + ' - ' + str(datetime.now())
123
    msg['From'] = ""
122
    msg['From'] = ""