File tree Expand file tree Collapse file tree 5 files changed +219
-110
lines changed Expand file tree Collapse file tree 5 files changed +219
-110
lines changed Original file line number Diff line number Diff line change 1+ from imports import *
2+
3+
4+ class Analytics (object ):
5+ def __init__ (self ):
6+ self .user = ref
7+ self .dict = dict ()
8+ self .container = deque ()
9+
10+ @staticmethod
11+ def finding_address ():
12+ val = get_mac ()
13+ return val
14+
15+ @staticmethod
16+ def finding_ip ():
17+ val = socket .gethostbyname (socket .gethostname ())
18+ return val
19+
20+ @staticmethod
21+ def finding_system ():
22+ return platform .system ()
23+
24+ def __setitem__ (self , key , val ):
25+ self .dict [key ] = val
26+
27+ def __getitem__ (self , key ):
28+ return self .dict [key ]
29+
30+ def random_string_generator (self , n = 10 ):
31+ random_str = '' .join (random .choice (string .ascii_uppercase + string .digits ) for _ in range (n ))
32+ return random_str
33+
34+ def insert_data (self ):
35+ random_str = self .random_string_generator (15 )
36+ self .container .append (random_str )
37+ self .user .child (random_str ).set (self .dict )
38+
39+ def update_data (self ):
40+ val = self .container .pop ()
41+ result = self .user .child (val )
42+ result .update ({
43+ 'finish_time' : str (datetime .datetime .now ())
44+ })
Original file line number Diff line number Diff line change 1+ data_det = {
2+ "apiKey" : "AIzaSyDhr5PJcaWBX15h1PayXSDpM-vsiqHqdUg" ,
3+ "authDomain" : "explainx-25b88.firebaseapp.com" ,
4+ "databaseURL" : "https://explainx-25b88.firebaseio.com" ,
5+ "projectId" : "explainx-25b88" ,
6+ "storageBucket" : "explainx-25b88.appspot.com" ,
7+ "messagingSenderId" : "150067985334" ,
8+ "appId" : "1:150067985334:web:a579d58390dee19837df17" ,
9+ "measurementId" : "G-SSP86WD8HG" ,
10+ "type" : "service_account"
11+ }
You can’t perform that action at this time.
0 commit comments