<?xml version="1.0" encoding="utf-8" ?>
<ignite version="1.0" source="openweathermap.org">
  <func name="city_weather" endpoint="http://api.openweathermap.org/data/2.5/weather?q={city},{country_code}" method="GET" format="XML">
    <description>This function returns the current weather data for a given city in a country</description>
    <example>
      =Ignite("openweathermap.org","city_weather","weather","London","UK")
    </example>
    <inputs>
      <input name="city" type ="input1" process="replace"/>
      <input name="country_code" type ="input2" process="replace"/>
      <input name="mode" type ="config" value="xml" />
      <input name="APPID" type ="config" value="9f10edacfccf7568bdc4248da72022d2" />
    </inputs>
    <outputs>
      <output name="weather" path="//weather/@value[1]"/>
      <output name="wind_speed" path="//wind/speed/@name[1]"/>
      <output name="wind_speed_number" path="//wind/speed/@value[1]"/>
      <output name="wind_direction" path="//wind/direction/@name[1]"/>
      <output name="temperature_min" path="//temperature/@min[1]"/>
      <output name="temperature_max" path="//temperature/@max[1]"/>
      <output name="temperature_unit" path="//temperature/@unit[1]"/>
      <output name="sun_rise_time" path="//sun/@rise[1]"/>
      <output name="sun_set_time" path="//sun/@set[1]"/>
      <output name="humidity" path="//humidity/@value[1]"/>
      <output name="humidity_unit" path="//humidity/@unit[1]"/>
      <output name="pressure" path="//pressure/@value[1]"/>
      <output name="pressure_unit" path="//pressure/@unit[1]"/>
    </outputs>
  </func>
  <func name="zip_weather" endpoint="http://api.openweathermap.org/data/2.5/weather?q={zip},{country_code}" method="GET" format="XML">
    <description>This function returns the current weather data for a given zip code in a country</description>
    <example>
      =Ignite("openweathermap.org","zip_weather","weather","94040","US")
    </example>
    <inputs>
      <input name="zip" type ="input1" process="replace"/>
      <input name="country_code" type ="input2" process="replace"/>
      <input name="mode" type ="config" value="xml" />
      <input name="APPID" type ="config" value="9f10edacfccf7568bdc4248da72022d2" />
    </inputs>
    <outputs>
      <output name="weather" path="//weather/@value[1]"/>
      <output name="wind_speed" path="//wind/speed/@name[1]"/>
      <output name="wind_speed_number" path="//wind/speed/@value[1]"/>
      <output name="wind_direction" path="//wind/direction/@name[1]"/>
      <output name="temperature_min" path="//temperature/@min[1]"/>
      <output name="temperature_max" path="//temperature/@max[1]"/>
      <output name="temperature_unit" path="//temperature/@unit[1]"/>
      <output name="sun_rise_time" path="//sun/@rise[1]"/>
      <output name="sun_set_time" path="//sun/@set[1]"/>
      <output name="humidity" path="//humidity/@value[1]"/>
      <output name="humidity_unit" path="//humidity/@unit[1]"/>
      <output name="pressure" path="//pressure/@value[1]"/>
      <output name="pressure_unit" path="//pressure/@unit[1]"/>
    </outputs>
  </func>

  <examples>
    <![CDATA[
<table border='1' class='ExcelTable2007'>
<tr><th class='heading'>&nbsp;</th><th>A</th><th>B</th><th>C (Forumla)</th><th>D (Output) </th></tr>
<tr><td class='heading' >1</td>
<td>London</td>
<td>UK</td>
<td>=Ignite("openweathermap.org","city_weather","weather",A1, B1)</td>
<td>Sky is Clear</td>
</tr>
<tr><td class='heading' >2</td>
<td>London</td>
<td>UK</td>
<td>=Ignite("openweathermap.org","city_weather","wind_speed",A2, B2)</td>
<td>Gentle Breeze</td>
</tr>
<tr><td class='heading' >3</td>
<td>London</td>
<td>UK</td>
<td>=Ignite("openweathermap.org","city_weather","wind_speed_number",A3, B3></td>
<td>4.11</td>
</tr>
<tr><td class='heading' >4</td>
<td>London</td>
<td>UK</td>
<td>=Ignite("openweathermap.org","city_weather","wind_direction",A4, B4)</td>
<td>NorthEast</td>
</tr>
<tr><td class='heading' >5</td>
<td>London</td>
<td>UK</td>
<td>=Ignite("openweathermap.org","city_weather","temperature_min",A5, B5)</td>
<td>278.571</td>
</tr>
<tr><td class='heading' >6</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","temperature_max",A6, B6)</td>
<td>282.691</td>
</tr>
<tr><td class='heading' >7</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","temperature_unit",A7, B7)</td>
<td>kelvin</td>
</tr>
<tr><td class='heading' >8</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","sun_rise_time",A8, B8)</td>
<td>2015-04-18T13:28:39</td>
</tr>
<tr><td class='heading' >9</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","sun_set_time",A9, B9)</td>
<td>2015-04-19T02:46:30</td>
</tr>
<tr><td class='heading' >10</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","humidity",A10, B10)</td>
<td>81</td>
</tr>
<tr><td class='heading' >11</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","pressure",A11, B11)</td>
<td>993.38</td>
</tr>
<tr><td class='heading' >12</td>
<td>94040</td>
<td>US</td>
<td>=Ignite("openweathermap.org","zip_weather","pressure_unit",A12, B12)</td>
<td>hPa</td>
</tr>

</table>
      ]]>
  </examples>
</ignite>
