Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Set job Cron weekly and update README.md #4

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Cron Job"

on:
schedule:
- cron: "0 1 * * *"
- cron: "0 0 * * 0"

jobs:
update:
Expand Down
82 changes: 70 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<h1 align="center">cvilleger/geo-gouv</h1>
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/cvilleger/geo-gouv/ci.yml?style=for-the-badge&branch=main)](https://github.com/cvilleger/geo-gouv/actions/workflows/ci.yml)
[![Packagist Version](https://img.shields.io/packagist/v/cvilleger/geo-gouv?style=for-the-badge)](https://packagist.org/packages/cvilleger/geo-gouv)
[![Packagist Downloads](https://img.shields.io/packagist/dt/cvilleger/geo-gouv?style=for-the-badge)](https://packagist.org/packages/cvilleger/geo-gouv)
[![GitHub License](https://img.shields.io/github/license/cvilleger/geo-gouv?style=for-the-badge)](https://github.com/cvilleger/geo-gouv?tab=MIT-1-ov-file#readme)

<p align="center">
<strong>Simple Geo Gouv Library.</strong>
</p>


<p align="center">
<a href="https://github.com/cvilleger/geo-gouv"><img src="https://img.shields.io/badge/source-cvilleger/geo-gouv.svg?style=flat-square" alt="Source Code"></a>
<a href="https://packagist.org/packages/cvilleger/geo-gouv"><img src="https://img.shields.io/packagist/v/cvilleger/geo-gouv.svg?style=flat-square" alt="Download Package"></a>
<a href="https://github.com/cvilleger/geo-gouv/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/cvilleger/geo-gouv/ci.yml?style=flat-square" alt="Build Status"></a>
<img alt="GitHub License" src="https://img.shields.io/github/license/cvilleger/geo-gouv?style=flat-square">
</p>
# cvilleger/geo-gouv

## About

Expand All @@ -35,11 +28,76 @@ composer require cvilleger/geo-gouv

## Usage

### Retrieve all departments

``` php
use Cvilleger\GeoGouv\Client;

$client = new Client();

$departements = $client->getDepartements();

print_r($departements[0]);
/*
Cvilleger\GeoGouv\Model\Departement Object
(
[nom] => Ain
[code] => 01
[codeRegion] => 84
[region] => Cvilleger\GeoGouv\Model\Region Object
(
[nom] => Ain
[code] => 01
)

)
*/
```

### Retrieve all municipalities by department code

``` php
use Cvilleger\GeoGouv\Client;

$client = new Client();

$communes = $client->getCommunesByDepartementCode('01');

print_r($communes[0]);
/*
(
[nom] => L'Abergement-Clémenciat
[code] => 01001
[codesPostaux] => Array
(
[0] => 01400
)

[centre] => Cvilleger\GeoGouv\Model\Centre Object
(
[type] => Point
[coordinates] => Array
(
[0] => 4.9306
[1] => 46.1517
)

)

[surface] => 1564.5
[population] => 832
[departement] => Cvilleger\GeoGouv\Model\CommuneDepartement Object
(
[nom] => Ain
[code] => 01
)

[region] => Cvilleger\GeoGouv\Model\CommuneRegion Object
(
[nom] => Auvergne-Rhône-Alpes
[code] => 84
)

)
*/
```