{"id":22576612,"url":"https://github.com/ndolestudio/darksky-php","last_synced_at":"2025-03-28T15:44:19.870Z","repository":{"id":57024434,"uuid":"151928776","full_name":"NdoleStudio/darksky-php","owner":"NdoleStudio","description":"A PHP wrapper for the Dark Sky Weather API","archived":false,"fork":false,"pushed_at":"2018-10-09T10:03:09.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T15:54:15.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NdoleStudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-07T10:12:35.000Z","updated_at":"2021-03-10T10:10:59.000Z","dependencies_parsed_at":"2022-08-23T13:50:25.319Z","dependency_job_id":null,"html_url":"https://github.com/NdoleStudio/darksky-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NdoleStudio%2Fdarksky-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NdoleStudio%2Fdarksky-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NdoleStudio%2Fdarksky-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NdoleStudio%2Fdarksky-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NdoleStudio","download_url":"https://codeload.github.com/NdoleStudio/darksky-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246057726,"owners_count":20716978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T04:07:21.671Z","updated_at":"2025-03-28T15:44:19.844Z","avatar_url":"https://github.com/NdoleStudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dark Sky PHP\n\nThis is a PHP wrapper for the official Dark Sky API found at [https://darksky.net/dev/docs](https://darksky.net/dev/docs)\n\n[![Latest Stable Version](https://poser.pugx.org/ndolestudio/darksky-php/v/stable)](https://packagist.org/packages/ndolestudio/darksky-php)\n[![Build Status](https://travis-ci.org/NdoleStudio/darksy-php.svg?branch=master)](https://travis-ci.org/NdoleStudio/darksy-php)\n[![Packagist](https://img.shields.io/packagist/dt/ndolestudio/darksky-php.svg)](https://packagist.org/packages/ndolestudio/darksky-php)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/NdoleStudio/darksky-php/master/LICENSE)\n## Getting Started\n\nThese instructions will guide you on how to install and use this package to get weather information using the Dark Sky API.\n\n### Prerequisites\n\nThis package works with PHP 7. So your php version must be greater `7.0` or later.\n\n### Installing\n\nThis package can be installed easily using composer.\n\n```\ncomposer install ndolestudio/darksky-php\n```\n\n## Example\n\nCreate a class which implements the `LocationDateTimeInput` interface. This class would be used as an input in the `DarkSkyApiClient`\n\n```php\nclass Request implements \\DarkSky\\Contracts\\LocationDateTimeInput\n{\n    public function getLatitude(): float\n    {\n        return 33.22;\n    }\n\n    public function getLongitude(): float\n    {\n        return 24.44;\n    }\n\n    public function getDateTime(): DateTime\n    {\n        return new DateTime('now');\n    }\n}\n```\n\nUse the `LocationDateTimeInput` class created above to fetch the weather data using the `DarkSkyApiClient`\n\n```php\n// Require composer dependencies.\nrequire './vendor/autoload.php';\n\n// Here, we create a DarkSkyApiConfiguration\n$apiConfiguration = new \\DarkSky\\Configurations\\DarkSkyApiConfiguration(\n    ['daily','currently'], // Excluded blocks\n    'https://api.darksky.net/forecast/b95b5555fb5f8e94cf499f4036618e55/', // Api Endpoint\n    'si' // Units\n);\n\n// Use the configuration to create a DarkSkyApiClient\n$darkSkyApiClient = new \\DarkSky\\Clients\\DarkSkyApiClient($apiConfiguration, new \\GuzzleHttp\\Client());\n\n// Create an instance of the LocationDateTimeInput\n$request = new Request();\n\n// This fetches the json response\n$jsonResponse = $darkSkyApiClient-\u003efetchWeatherData($request);\n```\n\n## Running the tests\n\nThe tests can be run using `PHPUnit`. The steps to run the tests are listed below\n\n\nAfter cloning this repository, download dependencies with composer\n\n```\ncomposer install\n```\n\nThe step above will install `PHPUnit` which you can run using the command below\n\n```\n./vendor/bin/phpunit\n```\n\n## Built With\n\n* [Guzzle](http://www.dropwizard.io/1.0.2/docs/) - The extensible PHP HTTP client\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). \n\n## Authors\n\n* **[AchoArnold](https://github.com/AchoArnold)**\n\nSee also the list of [contributors](https://github.com/NdoleStudio/darksky-php/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndolestudio%2Fdarksky-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndolestudio%2Fdarksky-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndolestudio%2Fdarksky-php/lists"}