Subversion Repositories SmartDukaan

Rev

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

Rev 15562 Rev 15563
Line 502... Line 502...
502
                                            break
502
                                            break
503
                            bulk.find({'orderId': activeOrder['orderId']}).update({'$set':{'closed': closed}})            
503
                            bulk.find({'orderId': activeOrder['orderId']}).update({'$set':{'closed': closed}})            
504
                bulk.execute()
504
                bulk.execute()
505
                return 'PARSED_SUCCESS'
505
                return 'PARSED_SUCCESS'
506
            else:
506
            else:
507
                merchantOrderId = re.findall(r'https://www.amazon.in/gp/css/summary/edit.html\?orderID=(.*)?', url, re.IGNORECASE)[0] 
507
                merchantOrderId = re.findall(r'https://www.amazon.in/gp/css/summary/edit.html\?orderID=(.*)?', url, re.IGNORECASE)[0]
-
 
508
                print  "merchantOrderId", merchantOrderId
508
                merchantOrder = self.db.merchantOrder.find_one({"merchantOrderId":merchantOrderId})
509
                merchantOrder = self.db.merchantOrder.find_one({"merchantOrderId":merchantOrderId})
509
                
510
                
510
                filename = directory + "/" + merchantOrderId   
511
                filename = directory + "/" + merchantOrderId   
511
                f = open(filename,'w')
512
                f = open(filename,'w')
512
                f.write(rawHtml) # python will convert \n to os.linesep
513
                f.write(rawHtml) # python will convert \n to os.linesep
Line 600... Line 601...
600
 
601
 
601
def main():
602
def main():
602
    #str1 = readSSh("/AmazonTrack/User533/403-3748792-1516356")
603
    #str1 = readSSh("/AmazonTrack/User533/403-3748792-1516356")
603
    #readSSh("/tmp/User2/404-2225153-7073122")
604
    #readSSh("/tmp/User2/404-2225153-7073122")
604
    
605
    
605
    store = getStore(1)
606
    #store = getStore(1)
606
    #store.scrapeStoreOrders()
607
    #store.scrapeStoreOrders()
607
#    br = mechanize.Browser()
608
#    br = mechanize.Browser()
608
#    br.addheaders = [('User-agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11'),
609
#    br.addheaders = [('User-agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11'),
609
#                     ('Accept', 'text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8'),
610
#                     ('Accept', 'text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8'),
610
#                     ('Accept-Encoding', 'gzip,deflate,sdch'),                  
611
#                     ('Accept-Encoding', 'gzip,deflate,sdch'),