Professional Documents
Culture Documents
Set Date
SCP GET Access.Log from N servers export json CRON N minutes : Script Counting IP | Visits CONCAT X && Y coordinates
IP | Visits | Country
Cron every N minutes (da vedere di non far coincidere i due cron) Popolare la colonna country con SCRIPT GETCountryFromIP
Nella tabella 2 Counter | Country | Timestamp vanno calcolate le visite per paese sommando le Visits di ogni paese Come si fa???
Ottengo Table2 Counter | Country | Timestamp da convertire in JSON ogni tot minuti in CRON
Ogni TOT la pagina PHP si refresha prendendo i nuovi dati JSON Put Export.CSV into MYSQL TABLE1 IP | COUNTRY | VISITS
Insert INTO T2 [Select xxx of T1] troncate t3 Se vuota, come ad es alle 6 am, prende i primi dati del giorno. se piena, aggiunge i nuovi parziali. ci saranno piu' record per country con tutti i parziali
insert into t3 select xxx of T2 prendere i dati e dividerli per 1000 PRIMA TRONCO poi join della T3 con la tabella delle coordinate
select coordinates.country, coordinates.longitude, coordinates.latitude, table3.totale from coordinates, table3 where coordinates.country = table3.country
export json
insert into table4(country, longitude, latitude, totale) select coordinates.country, coordinates.longitude, coordinates.latitude, table3.totale from coordinates, table3 where coordinates.country = table3.country
SELECT CONCAT ( "[", GROUP_CONCAT( CONCAT(LATITUDE,","), CONCAT(LONGITUDE,","), CONCAT(TOTALE/1000) ) , "]" ) AS JSON FROM table4
SELECT CONCAT( "[[\"VISITE\",[", GROUP_CONCAT( CONCAT(LATITUDE,","), CONCAT(LONGITUDE,","), CONCAT(TOTALE/1000) ) , "]]]" ) AS JSON FROM table4
$filename = time() . '.txt'; $fp = fopen($filename,'w'); fputs($fp,$mysql); fclose($fp); If you want the filename with actual date numbering instead of a UNIX timestamp, use this instead: $filename = date('YmdHis').'.txt'; You'll have to get your data into an exportable format of course... the code above assumes that $mysql contains your data and not just a query resource.
INSERT INTO JSON(JSON) SELECT CONCAT( "[[\"VISITE\",[", GROUP_CONCAT( CONCAT(LATITUDE2,","), CONCAT(LONGITUDE2,","), CONCAT(COUNTER2/1000) ) , "]]]" ) AS JSON FROM TABLE_B