IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Discussion :

Widget météo configurable


Sujet :

Services

  1. #1
    Membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Points : 48
    Points
    48
    Par défaut Widget météo configurable
    Bonjour,

    Je recherche un widget météo configurable. Avec la possibilité de mettre un code postal ou une ville et de récupérer la météo associé.

    Merci d'avance

  2. #2
    Futur Membre du Club
    Homme Profil pro
    Webdesigner
    Inscrit en
    Novembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Novembre 2009
    Messages : 5
    Points : 8
    Points
    8
    Par défaut Météo google api
    Bonjour,

    Voici l'API de google que j'utilise
    http://www.google.com/ig/api?weather...u code postale

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    <?
    $xml = simplexml_load_file('http://www.google.com/ig/api?weather=jakarta');
    $information = $xml->xpath("/xml_api_reply/weather/forecast_information");
    $current = $xml->xpath("/xml_api_reply/weather/current_conditions");
    $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
    ?>
    <html>
        <head>
            <title>API Météo</title>
        </head>
        <body>
            <h1><?= print $information[0]->city['data']; ?></h1>
            <h2>Météo actuelle</h2>
            <div class="weather">		
                <img src="<?= 'http://www.google.com' . $current[0]->icon['data']?>" alt="weather"?>
                <span class="condition">
                <?= $current[0]->temp_f['data'] ?>&deg; F,
                <?= $current[0]->condition['data'] ?>
                </span>
            </div>
            <h2>prévistion</h2>
            <? foreach ($forecast_list as $forecast) : ?>
            <div class="weather">
                <img src="<?= 'http://www.google.com' . $forecast->icon['data']?>" alt="weather"?>
                <div><?= $forecast->day_of_week['data']; ?></div>
                <span class="condition">
    	            <?= $forecast->low['data'] ?>&deg; F - <?= $forecast->high['data'] ?>&deg; F,
    	            <?= $forecast->condition['data'] ?>
                </span>
            </div>	
            <? endforeach ?>
        </body>
    </html>

  3. #3
    Membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Points : 48
    Points
    48
    Par défaut
    Ah je ne savais pas que google avait une API météo

  4. #4
    Membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Points : 48
    Points
    48
    Par défaut
    Merci c'est exactement ce que je cherché

  5. #5
    Membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Points : 48
    Points
    48
    Par défaut
    Rah j'ai une erreur que je ne comprend pas :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Warning: simplexml_load_file(): http://www.google.com/ig/api?weather=trappes:1: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xCE 0x6C 0x65 0x2D in /xxx/xxx/xx/xx/apps/recruteur/modules/accueil/templates/indexSuccess.php on line 14 Warning: simplexml_load_file(): bile_zipped="1" row="0" section="0" >
    J'ai beau mettre les utf8_encode / decode, ca ne change rien. Une idée ?

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Webdesigner
    Inscrit en
    Novembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Webdesigner

    Informations forums :
    Inscription : Novembre 2009
    Messages : 5
    Points : 8
    Points
    8
    Par défaut
    merci de bien vouloir publier le code du fichier indexSuccess.php pour voir exactement d'ou vien l'erreur

  7. #7
    Nouveau Candidat au Club
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Octobre 2011
    Messages : 1
    Points : 1
    Points
    1
    Par défaut météo paris
    météo paris La Ville de Paris bénéficie d'un climat tempéré en raison de sa localisation en Europe occidentale et les effets du réchauffement du Gulf Stream.

Discussions similaires

  1. widget configure depuis hash
    Par magicshark dans le forum Interfaces Graphiques
    Réponses: 7
    Dernier message: 02/03/2013, 13h25
  2. [1.x] configuration d'une widget d'un formulaire
    Par nawbacan dans le forum Symfony
    Réponses: 12
    Dernier message: 06/10/2010, 17h06
  3. [configuration] lancer plusieurs serveurs Tomcat
    Par polo54 dans le forum JBuilder
    Réponses: 4
    Dernier message: 13/06/2003, 15h52
  4. Configurer OpenGL/Glut avec C++Bluider
    Par MiGoN dans le forum OpenGL
    Réponses: 2
    Dernier message: 13/09/2002, 23h18
  5. BDE : Configurer automatiquement le NETDIR
    Par Harry dans le forum Paradox
    Réponses: 10
    Dernier message: 29/07/2002, 11h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo