| 123456789101112131415161718192021222324 |
- <?php
- namespace Heanup\Library\WeatherAdapt;
- class tianqiapiAdapter implements Weather
- {
- public function __construct()
- {
- }
- public function getWeatherData($city_id)
- {
- $data=file_get_contents(sprintf("https://www.tianqiapi.com/api/?version=v1&cityid=%s", $city_id));
- return json_decode($data,true);
- }
- public function parseData($data1, $data2)
- {
- // TODO: 需要实现 parseData() 方法.
- }
- }
|