コード例 #1
0
    def post(self):
        tIpLookup = IpLookup()
        tIpStore = IpInfo()
        tIp = str(self.request.get('ip'))
        tTransactionId = str(self.request.get('transid'))

        tIpInfo = {}
        #logging.debug("Scraping Ip: " + tIp)

        if (tIp != None and len(tIp) > 0):
            tIpInfo = tIpLookup.IpInfoScraper(tIp)
        else:
            tIpInfo = {}
            tIpInfo['country'] = ""
            tIpInfo['host'] = ""
            tIpInfo['state'] = ""
            tIpInfo['isp'] = ""
            tIpInfo['proxy'] = ""
            tIpInfo['type'] = ""

        tIpStore.ip = tIp
        tIpStore.ipCountry = tIpInfo['country']
        tIpStore.ipHost = tIpInfo['host']
        tIpStore.ipState = tIpInfo['state']
        tIpStore.ipIsp = tIpInfo['isp']
        tIpStore.ipProxy = tIpInfo['proxy']
        tIpStore.ipType = tIpInfo['type']
        tIpStore.ipOrder = tTransactionId
        tIpKey = tIpStore.put()

        #logging.debug("Stored IP: " + tIp + " at Key " + str(tIpKey))

        tOrder = Order()
        tOrderQuery = Order().all()
        #logging.debug("Transaction Id: " + tTransactionId)
        tOrderQuery.filter("orderTransactionId", tTransactionId)
        tOrder = tOrderQuery.fetch(1)[0]

        tMobilePhone = tOrder.orderMobileNumber
        tCustomerKey = tOrder.orderCustomer
        tOrderKey = str(tOrder.key())
        #logging.debug("IP Address Mobile Number " + str(tMobilePhone))
        if (tMobilePhone != None and len(tMobilePhone) > 0):
            taskqueue.add(url="/phonelookup",
                          countdown=1,
                          params={
                              "order": tOrderKey,
                              "customer": tCustomerKey,
                              "ipcountry": tIpStore.ipCountry
                          })
コード例 #2
0
 def post(self):
     tIpLookup = IpLookup()
     tIpStore = IpInfo()
     tIp = str(self.request.get('ip'))
     tTransactionId = str(self.request.get('transid'))
     
     tIpInfo = {}
     #logging.debug("Scraping Ip: " + tIp)
     
     if (tIp != None and len(tIp) > 0):
         tIpInfo = tIpLookup.IpInfoScraper(tIp)
     else:
         tIpInfo = {}
         tIpInfo['country'] = ""
         tIpInfo['host'] = ""
         tIpInfo['state'] = ""
         tIpInfo['isp'] = ""
         tIpInfo['proxy'] = ""
         tIpInfo['type'] = ""
     
     tIpStore.ip = tIp
     tIpStore.ipCountry = tIpInfo['country']
     tIpStore.ipHost = tIpInfo['host']
     tIpStore.ipState = tIpInfo['state']
     tIpStore.ipIsp = tIpInfo['isp']
     tIpStore.ipProxy = tIpInfo['proxy']
     tIpStore.ipType = tIpInfo['type']
     tIpStore.ipOrder = tTransactionId
     tIpKey = tIpStore.put()
     
     #logging.debug("Stored IP: " + tIp + " at Key " + str(tIpKey))
     
     tOrder = Order()
     tOrderQuery = Order().all()
     #logging.debug("Transaction Id: " + tTransactionId)
     tOrderQuery.filter("orderTransactionId", tTransactionId)
     tOrder = tOrderQuery.fetch(1)[0]
     
     tMobilePhone = tOrder.orderMobileNumber
     tCustomerKey = tOrder.orderCustomer
     tOrderKey = str(tOrder.key())
     #logging.debug("IP Address Mobile Number " + str(tMobilePhone))
     if (tMobilePhone != None and len(tMobilePhone) > 0):
         taskqueue.add(url="/phonelookup", countdown = 1, params = { "order": tOrderKey, 
                                                                     "customer": tCustomerKey,
                                                                     "ipcountry": tIpStore.ipCountry } )