PHP Classes

File: demos/003.php

Recommend this page to a friend!
  Classes of Tom Schaefer   Wunderground Weather API   demos/003.php   Download  
File: demos/003.php
Role: Example script
Content type: text/plain
Description: shockwave flash example
Class: Wunderground Weather API
Retrieve weather forecasts with Wunderground API
Author: By
Last change:
Date: 11 years ago
Size: 1,197 bytes
 

Contents

Class file image Download
<?php

if(!isset($_GET["f"])) {

?>
<html>
<head>
<title>Embed SWF</title>
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="movie_name" align="middle">
    <param name="movie" value="003.php?f=1"/>
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="003.php?f=1" width="550" height="400">
        <param name="movie" value="003.php?f=1"/>
    <!--<![endif]-->
        <a href="http://www.adobe.com/go/getflash">
            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/>
        </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
</object>
</body>
</html>
<?php

} else {
   
header("Content-Type: application/x-shockwave-flash");

include_once
'../api.wunderground.classes.inc.php';

# to get an api key register here http://www.wunderground.com/weather/api/

$weather = WundergroundWeather::getInstance("DE")
    ->
apikey("--api key here--")->Layers()
            ->
Radar(array("width"=>550, "height"=>400))
            ->
asSWF()
            ->
CityCountry("MI", "Ann_Arbor")
    ->
doRequest()
->
getResult();
echo
$weather;

}