Changeset 733 for trunk/temp/meteo/load_meteo.php
- Timestamp:
- Feb 11, 2015, 10:59:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/temp/meteo/load_meteo.php
r548 r733 49 49 $this->Data = $Data; 50 50 } 51 51 52 52 function SaveDataToDb() 53 53 { … … 106 106 } 107 107 108 function median($Array) 109 { 110 return($Array[count($Array) / 2]); 111 } 112 108 113 $Meteo = new MeteoStation(); 109 114 $Meteo->URL = 'http://meteo-koliba.zdechov.net/status.xml'; … … 112 117 $URL = 'http://stat.zdechov.net/meteo/add.php'; 113 118 $I = 0; 119 $Collect = array(); 114 120 while(1) 115 121 { 116 122 $Meteo->DownloadData(); 117 123 $Meteo->CreateImage('koliba.png'); 124 foreach($Meteo->Data as $Index => $Item) 125 { 126 $Collect[$Index][] = $Item; 127 } 118 128 if(($I % 6) == 0) 119 129 { 120 file_get_contents($URL.'?MeasureId=28&Value='.$Meteo->Data['Temperature']); 121 file_get_contents($URL.'?MeasureId=29&Value='.$Meteo->Data['AbsHumidity']); 122 file_get_contents($URL.'?MeasureId=30&Value='.$Meteo->Data['BarAltitude']); 123 file_get_contents($URL.'?MeasureId=31&Value='.$Meteo->Data['DewPoint']); 124 file_get_contents($URL.'?MeasureId=32&Value='.$Meteo->Data['Pressure']); 125 file_get_contents($URL.'?MeasureId=33&Value='.$Meteo->Data['RelHumidity']); 126 file_get_contents($URL.'?MeasureId=34&Value='.$Meteo->Data['SysTemp']); 127 file_get_contents($URL.'?MeasureId=35&Value='.$Meteo->Data['WindChill']); 128 file_get_contents($URL.'?MeasureId=36&Value='.$Meteo->Data['WindDir']); 129 file_get_contents($URL.'?MeasureId=37&Value='.$Meteo->Data['WindGust']); 130 file_get_contents($URL.'?MeasureId=38&Value='.$Meteo->Data['WindSpeed']); 130 foreach($Collect as $Index => $Item) 131 { 132 sort($Collect[$Index]); 133 } 134 file_get_contents($URL.'?MeasureId=28&Value='.median($Collect['Temperature'])); 135 file_get_contents($URL.'?MeasureId=29&Value='.median($Collect['AbsHumidity'])); 136 file_get_contents($URL.'?MeasureId=30&Value='.median($Collect['BarAltitude'])); 137 file_get_contents($URL.'?MeasureId=31&Value='.median($Collect['DewPoint'])); 138 file_get_contents($URL.'?MeasureId=32&Value='.median($Collect['Pressure'])); 139 file_get_contents($URL.'?MeasureId=33&Value='.median($Collect['RelHumidity'])); 140 file_get_contents($URL.'?MeasureId=34&Value='.median($Collect['SysTemp'])); 141 file_get_contents($URL.'?MeasureId=35&Value='.median($Collect['WindChill'])); 142 file_get_contents($URL.'?MeasureId=36&Value='.median($Collect['WindDir'])); 143 file_get_contents($URL.'?MeasureId=37&Value='.median($Collect['WindGust'])); 144 file_get_contents($URL.'?MeasureId=38&Value='.median($Collect['WindSpeed'])); 145 $Collect = array(); 131 146 } 132 147 sleep(10);
Note:
See TracChangeset
for help on using the changeset viewer.