1 | <?php |
||
5 | class FakeData |
||
6 | { |
||
7 | const WEATHER_GROUP_JSON = '{ |
||
8 | "list":[{ |
||
9 | "id":1851632, |
||
10 | "dt":1406106000, |
||
11 | "coord":{"lon":138.933334,"lat":34.966671}, |
||
12 | "sys":{"type":3,"id":168940,"message":0.0297,"country":"US","sunrise":1427723751,"sunset":1427768967}, |
||
13 | "name":"Shuzenji", |
||
14 | "main":{ |
||
15 | "temp":298.77, |
||
16 | "temp_min":298.77, |
||
17 | "temp_max":298.774, |
||
18 | "pressure":1005.93, |
||
19 | "sea_level":1018.18, |
||
20 | "grnd_level":1005.93, |
||
21 | "humidity":87 |
||
22 | }, |
||
23 | "weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}], |
||
24 | "clouds":{"all":88}, |
||
25 | "wind":{"speed":5.71,"deg":229.501}, |
||
26 | "dt_txt":"2014-07-23 09:00:00" |
||
27 | },{ |
||
28 | "id":1851632, |
||
29 | "dt":1406106000, |
||
30 | "coord":{"lon":138.933334,"lat":34.966671}, |
||
31 | "sys":{"type":3,"id":168940,"message":0.0297,"country":"US","sunrise":1427723751,"sunset":1427768967}, |
||
32 | "name":"Shuzenji", |
||
33 | "main":{ |
||
34 | "temp":298.77, |
||
35 | "temp_min":298.77, |
||
36 | "temp_max":298.774, |
||
37 | "pressure":1005.93, |
||
38 | "sea_level":1018.18, |
||
39 | "grnd_level":1005.93, |
||
40 | "humidity":87 |
||
41 | }, |
||
42 | "weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}], |
||
43 | "clouds":{"all":88}, |
||
44 | "wind":{"speed":5.71,"deg":229.501}, |
||
45 | "dt_txt":"2014-07-23 09:00:00" |
||
46 | }] |
||
47 | }'; |
||
48 | |||
49 | public static function forecastXML() |
||
91 | |||
92 | const WEATHER_HISTORY_JSON = '{ |
||
93 | "cod":"200","calctime":"123456789","message":0.0032,"city_id":{"id":1851632,"name":"Shuzenji","coord":{"lon":138.933334,"lat":34.966671},"country":"JP"}, |
||
94 | "cnt":10, |
||
95 | "list":[{ |
||
96 | "dt":1406080800, |
||
97 | "temp":{ |
||
98 | "day":297.77, |
||
99 | "min":293.52, |
||
100 | "max":297.77, |
||
101 | "night":293.52, |
||
102 | "eve":297.77, |
||
103 | "morn":297.77 |
||
104 | }, |
||
105 | "pressure":925.04, |
||
106 | "humidity":76, |
||
107 | "weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}], |
||
108 | "main":{"temp":306.15,"pressure":1013,"humidity":44,"temp_min":306,"temp_max":306}, |
||
109 | "clouds":{"all":90}, |
||
110 | "wind":{"speed":5.71,"deg":229.501} |
||
111 | },{ |
||
112 | "dt":1406080800, |
||
113 | "temp":{ |
||
114 | "day":297.77, |
||
115 | "min":293.52, |
||
116 | "max":297.77, |
||
117 | "night":293.52, |
||
118 | "eve":297.77, |
||
119 | "morn":297.77 |
||
120 | }, |
||
121 | "pressure":925.04, |
||
122 | "humidity":76, |
||
123 | "weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}], |
||
124 | "main":{"temp":306.15,"pressure":1013,"humidity":44,"temp_min":306,"temp_max":306}, |
||
125 | "clouds":{"all":90}, |
||
126 | "wind":{"speed":5.71,"deg":229.501} |
||
127 | }] |
||
128 | }'; |
||
129 | |||
130 | const CURRENT_WEATHER_XML = <<<XML |
||
131 | <current> |
||
132 | <city id="2950159" name="Berlin"> |
||
133 | <coord lon="13.41" lat="52.52"></coord> |
||
134 | <country>DE</country> |
||
135 | <sun rise="2017-01-02T07:16:51" set="2017-01-02T15:04:50"></sun> |
||
136 | </city> |
||
137 | <temperature value="36.48" min="35.6" max="37.4" unit="fahrenheit"></temperature> |
||
138 | <humidity value="86" unit="%"></humidity> |
||
139 | <pressure value="1014" unit="hPa"></pressure> |
||
140 | <wind> |
||
141 | <speed value="9.17" name="Fresh Breeze"></speed> |
||
142 | <gusts></gusts> |
||
143 | <direction value="300" code="WNW" name="West-northwest"></direction> |
||
144 | </wind> |
||
145 | <clouds value="75" name="broken clouds"></clouds> |
||
146 | <visibility value="8000"></visibility> |
||
147 | <precipitation mode="no"></precipitation> |
||
148 | <weather number="500" value="light rain" icon="10d"></weather> |
||
149 | <lastupdate value="2017-01-02T12:20:00"></lastupdate> |
||
150 | </current> |
||
151 | XML; |
||
152 | } |
||
153 |