Subversion Repositories SmartDukaan

Rev

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

Rev 21264 Rev 21266
Line 40... Line 40...
40
AFF_STATUS_APPROVED='approved'
40
AFF_STATUS_APPROVED='approved'
41
AFF_STATUS_DISAPPROVED='disapproved'
41
AFF_STATUS_DISAPPROVED='disapproved'
42
AFF_STATUS_PENDING='pending'
42
AFF_STATUS_PENDING='pending'
43
statuses = [AFF_STATUS_CANCELLED, AFF_STATUS_APPROVED, AFF_STATUS_DISAPPROVED,AFF_STATUS_PENDING ]
43
statuses = [AFF_STATUS_CANCELLED, AFF_STATUS_APPROVED, AFF_STATUS_DISAPPROVED,AFF_STATUS_PENDING ]
44
categoryMap = {3:"Mobiles", 5:"Tablets"}
44
categoryMap = {3:"Mobiles", 5:"Tablets"}
-
 
45
 
-
 
46
headers = { 
45
mobileAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4'
47
            'User-agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4',
-
 
48
            'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',      
-
 
49
            'Accept-Language' : 'en-US,en;q=0.8',                     
-
 
50
            'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
-
 
51
            'Connection':'keep-alive',
-
 
52
            'Accept-Encoding' : 'gzip,deflate,sdch'
-
 
53
        }
46
 
54
 
47
class Store(MStore):
55
class Store(MStore):
48
    OrderStatusMap = {
56
    OrderStatusMap = {
49
                      main.Store.ORDER_PLACED : ['approval', 'processing', 'shipping'],
57
                      main.Store.ORDER_PLACED : ['approval', 'processing', 'shipping'],
50
                      main.Store.ORDER_DELIVERED : ['your item has been delivered'],
58
                      main.Store.ORDER_DELIVERED : ['your item has been delivered'],
Line 102... Line 110...
102
        for order in orders:
110
        for order in orders:
103
            print "Order", self.store_name, order['orderId']
111
            print "Order", self.store_name, order['orderId']
104
            try:
112
            try:
105
                closed = True
113
                closed = True
106
                url = ORDER_TRACK_URL + urlparse(order['orderSuccessUrl']).query    
114
                url = ORDER_TRACK_URL + urlparse(order['orderSuccessUrl']).query    
107
                page = fetchResponseUsingProxy(url)
115
                page = fetchResponseUsingProxy(url, headers)
108
                soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
116
                soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
109
                
117
                
110
                sections = soup.findAll("div", {"class":"ui-app-card-body"})
118
                sections = soup.findAll("div", {"class":"ui-app-card-body"})
111
                sections.pop(1)
119
                sections.pop(1)
112
        
120