Giter Site home page Giter Site logo

scrapingmeteogp's Introduction

ScrapingMeteoGp

Script php pour récupérer sur le site http://www.meteofrance.gp les vigilances météo des Antilles Française.

Les couleurs (verte, jaune, orange, rouge, violette, grise) et les types de vigilance (vent, vague, pluie, cyclone) sont récupérés à partir de l'image ci-dessous.

Ce script est utilisé pour le site http://www.alerte.mq/.

Carte vigilance cyclone Irma
Carte Météo France pendant le cyclone Irma en septembre 2017
http://www.meteofrance.gp/integration/sim-portail/generated/integration/img/vigilance/fr_99.gif

Installation

Installation method via composer. Add this minimum code in your composer.json file.

{
    "require": {
        "b1nj/scrapingMeteoGp": "dev-master@dev"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "https://github.com/b1nj/scrapingMeteoGp.git"
        }
    ]
}

And execute this command :

$ composer update

Usage

The simplest usage of the library would be as follows:

<?php

require_once __DIR__ . '/vendor/autoload.php';

use B1nj\ScrapingMeteoGp\Scraping;

$zones = new Scraping();
foreach ($zones as $zone => $vigilance) {
    var_dump($zone, $vigilance);
}

To not load the image each time. Create a file with with in content date past like 2017-01-01 10:00:00.

$zones = new Scraping(null, 'tmp/meteogp_lastmodified.txt');

Unit Testing

Unit testing for ScrapingMeteoGp is done using PHPUnit.

To execute tests, run vendor/bin/phpunit from the command line while in the root directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.