NWS Weather Module API

I'm using the NWS Weather module. The builtin block works great but I want to display the current temperatures from two other nearby cities. In the readme file they state.

The block defined by NWS_weather allows simple access to weather forecast data for one point. Developers who would like to retrieve data for multiple points or who wish to retrieve more data (wind speed, wind direction, etc.) can utilize this module by calling this function:

$forecast=nws_weather_NDFDgen($lat, $lon, array('wdir', 'temp', 'maxt', 'mint'), "time-series", "2009-12-08T12:00:00", "2009-12-09T12:00:00");

I'm not a developer and have no idea how to use this. I'm wondering if someone could give me some sample code I could work with. I'm working with the 7.x-1.3 version. Thanks guys.

https://drupal.org/project/nws_weather

Please follow the steps:

  1. If you haven't the "PHP filter" module enabled, enable it.
  2. Create a custom "Block".
  3. Set body content as following:

<?php

$forecast = nws_weather_NDFDgenByDay('47.53', '-122.30');

echo theme('nws_weather_forecast', 
          array(
            'dataForecast' => $forecast, 
            'required' => array('Daily Maximum Temperature', 'Daily Minimum Temperature', 'Conditions Icons', ), 
            'display' => array('Conditions Icons', 'Weather Type, Coverage, and Intensity', 'Daily Maximum Temperature', 'Daily Minimum Temperature', )
          )
);

?>

Here, 47.53 is lat or latitude and -122.30 is long or longitude. You can also pass day count to display for specific days. Like:

$forecast = nws_weather_NDFDgenByDay('47.53', '-122.30', 7);

This will load updates for 7 days.

Then save the Block. And set the currently created block to any region. See the result in front-end. :)