weatherdtAdapter.php 471 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Heanup\Library\WeatherAdapt;
  3. class weatherdtAdapter implements Weather
  4. {
  5. public function __construct()
  6. {
  7. }
  8. public function getWeatherData($city_id)
  9. {
  10. $data = file_get_contents(sprintf("https://apip.weatherdt.com/plugin/data?key=j3fsWopid0&location=%s", $city_id));
  11. return json_decode($data, true);
  12. }
  13. public function parseData($data1,$data2)
  14. {
  15. // TODO: 需要实现 parseData() 方法.
  16. }
  17. }