承接 sablesoft/api-openweather 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sablesoft/api-openweather

Composer 安装命令:

composer require sablesoft/api-openweather

包简介

A php service for Open Weather API

README 文档

README

PHP Service for the Open Weather API

Installation

Using composer:

"require": {
    "sablesoft/api-openweather": "*"
}

Via CLI:

composer require sablesoft/api-openweather

Configuration

Required configurations:

  • The appId must be set in your application. (Please see here to get one)

Custom configurations:

  • the Base URL and Default Guzzle Options. (Please see here for possible options)

Usage

See below for sample initialization code:

<?php

include_once 'vendor/autoload.php';

use SableSoft\OpenWeather\Service;

$appId = 'your_appid_here';
$options = [
    'endpount' => 'http://api.openweathermap.org' // already set as default
    'timeout' => 3, // default
    'connect_timeout' => 3 // default
];

$service = Service::getInstance($appId, $baseUrl, $options);

// get weather forecast by city:
$response = $service->getByCity('Minsk');
if ($response->isValid()) {
    print_r($response->getData());
}

// get weather forecast by coordinates:
$response = $service->get(53.9006, 27.5590);
if ($response->isValid()) {
    print_r($response->getData());
}

?>

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固