81 d = datetime.datetime.today()
82
83 i = 0
84 for data in line:
85 if gi.record_by_name(data["IPADDRESS"]) != None:
86 i = i+1
87 ipaddress = data["IPADDRESS"]
88 latitude = gi.record_by_name(data["IPADDRESS"])["latitude"]
89 longitude = gi.record_by_name(data["IPADDRESS"])["longitude"]
90
91 add_RemoteData = ( "INSERT INTO geoips "
92 "(created_at,updated_at,ipaddress,latitude,longitude) "
93 "VALUES(%s,%s,%s,%s,%s)")
94 data_RemoteData = ( d, d, ipaddress, latitude, longitude )
95 cursor.execute(add_RemoteData,data_RemoteData)
0 件のコメント:
コメントを投稿