| Line 116... |
Line 116... |
| 116 |
merchantOrder.createdOnInt = mo.get("createdOnInt")
|
116 |
merchantOrder.createdOnInt = mo.get("createdOnInt")
|
| 117 |
else:
|
117 |
else:
|
| 118 |
print "Could not find amazon order with order Id", orderId
|
118 |
print "Could not find amazon order with order Id", orderId
|
| 119 |
merchantOrder = Order(orderId, userId, subTagId, self.store_id, orderSuccessUrl)
|
119 |
merchantOrder = Order(orderId, userId, subTagId, self.store_id, orderSuccessUrl)
|
| 120 |
soup = BeautifulSoup(rawHtml)
|
120 |
soup = BeautifulSoup(rawHtml)
|
| 121 |
if soup.body:
|
121 |
if not soup.body:
|
| 122 |
resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
|
122 |
resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
|
| 123 |
else:
|
123 |
else:
|
| 124 |
try:
|
124 |
try:
|
| 125 |
self.parseNewStlye(merchantOrder, soup)
|
125 |
self.parseNewStlye(merchantOrder, soup)
|
| 126 |
resp['result'] = 'DETAIL_CREATED'
|
126 |
resp['result'] = 'DETAIL_CREATED'
|
| Line 716... |
Line 716... |
| 716 |
#process_rejects("/home/amit/Downloads/RejectCashbackTemplate.xlsx")
|
716 |
#process_rejects("/home/amit/Downloads/RejectCashbackTemplate.xlsx")
|
| 717 |
#str1 = readSSh("/AmazonTrack/User2466/orderSummary28-06:13:25:08")
|
717 |
#str1 = readSSh("/AmazonTrack/User2466/orderSummary28-06:13:25:08")
|
| 718 |
#readSSh("/tmp/User2/404-2225153-7073122")
|
718 |
#readSSh("/tmp/User2/404-2225153-7073122")
|
| 719 |
#for orderId, trackingUrl in all.iteritems():
|
719 |
#for orderId, trackingUrl in all.iteritems():
|
| 720 |
store = getStore(1)
|
720 |
store = getStore(1)
|
| - |
|
721 |
store.parseOrderRawHtml(46417, '3442342424334344', 9722, readSSh("~/46417.html"), "https://www.amazon.in/gp/css/summary/edit.html?orderID=171-7620214-4375503")
|
| 721 |
# print store.parseTrackingUrl(trackingUrl, orderId)
|
722 |
# print store.parseTrackingUrl(trackingUrl, orderId)
|
| 722 |
#store.scrapeStoreOrders()
|
723 |
#store.scrapeStoreOrders()
|
| 723 |
# store.scrapeStoreOrders()
|
724 |
# store.scrapeStoreOrders()
|
| 724 |
#store.parseInfo()
|
725 |
#store.parseInfo()
|
| 725 |
#store.trackOrdersForUser(4355, "https://www.amazon.in/gp/css/summary/edit.html?orderID=171-4824011-7090713", readSSh("~/4355"))
|
726 |
#store.trackOrdersForUser(4355, "", readSSh("~/4355"))
|
| 726 |
#readSSh("/tmp/User211/2015-04-12 10:32:41.905765")
|
727 |
#readSSh("/tmp/User211/2015-04-12 10:32:41.905765")
|
| 727 |
#store.scrapeAffiliate()
|
728 |
#store.scrapeAffiliate()
|
| 728 |
#parseDetailNotCreated()
|
729 |
#parseDetailNotCreated()
|
| 729 |
#parseOrderNotCreated()
|
730 |
#parseOrderNotCreated()
|
| 730 |
for userId in store.db.merchantOrder.find({"storeId":1, "subOrders.closed":False}).distinct("userId"):
|
731 |
# for userId in store.db.merchantOrder.find({"storeId":1, "subOrders.closed":False}).distinct("userId"):
|
| 731 |
userId = int(userId)
|
732 |
# userId = int(userId)
|
| 732 |
directory = "/AmazonTrack/User" + str(userId) + "/"
|
733 |
# directory = "/AmazonTrack/User" + str(userId) + "/"
|
| 733 |
summaryFile=getSummaryFile(directory)
|
734 |
# summaryFile=getSummaryFile(directory)
|
| 734 |
if summaryFile is None:
|
735 |
# if summaryFile is None:
|
| 735 |
print "No summary for", userId
|
736 |
# print "No summary for", userId
|
| 736 |
else:
|
737 |
# else:
|
| 737 |
print userId, directory+summaryFile
|
738 |
# print userId, directory+summaryFile
|
| 738 |
store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
739 |
# store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
| 739 |
|
740 |
|
| 740 |
#store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
|
741 |
#store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
|
| 741 |
|
742 |
|
| 742 |
def getSummaryFile(directory):
|
743 |
def getSummaryFile(directory):
|
| 743 |
date1 = datetime(2015,1,1)
|
744 |
date1 = datetime(2015,1,1)
|
| Line 847... |
Line 848... |
| 847 |
|
848 |
|
| 848 |
finally:
|
849 |
finally:
|
| 849 |
session.close()
|
850 |
session.close()
|
| 850 |
|
851 |
|
| 851 |
if __name__ == '__main__':
|
852 |
if __name__ == '__main__':
|
| 852 |
#readSSh("~/AmazonTrack/User/orderSummary14-10:18:29:25")
|
853 |
# readSSh("~/46417.html")
|
| 853 |
main()
|
854 |
main()
|
| 854 |
#getDateStringArriving()
|
855 |
#getDateStringArriving()
|
| 855 |
|
856 |
|