Rev 17072 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
'''Created on Apr 28, 2015@author: amit'''from dtr.main import clientfrom dtr.utils.utils import sendNotificationdef main():#scrapepaytm()db = client.DtrbatchId = db.refund.findOne({"$query":{},"$orderby":{"batch":-1}}).get("batch")if batchId is None:returnrefunds = db.refund.find({"batch":batchId})#refunds = [{"timestamp" : "2015-04-14 00:00:02", "userId" : 2, "batch" : 1428949802, "userAmount" : 847 }]sendNotification([8], 'Batch Credit', 'Cashback Credited', 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(8))sendNotification([14], 'Batch Credit', 'Cashback Credited', 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(14))for ref in refunds:print ref.get("userId"), ref.get("userAmount")#sendNotification([ref.get("userId")], 'Batch Credit', 'Cashback Credited', 'Rs.%s has been added to your wallet'%(ref.get("userAmount")), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(ref.get("userId")))passif __name__ == '__main__':main()