Rev 14995 | Rev 17073 | 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.find_one({"$query":{},"$orderby":{"batch":-1}}).get("batch")print "Batch Id recently Credited", batchIdif batchId is None:returnrefunds = db.refund.find({"batch":batchId})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'%(int(ref.get("userAmount"))), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(ref.get("userId")))passif __name__ == '__main__':main()