You need to put the file WeatherMapDataSource_nagios.php into lib/datasources under your Weathermap directory, with read permission set. Then all should work.
To use this, you need to make sure your Weathermap configuration file specifies the plugin parameters, and the datasource.
You need to define options telling the plugin which method it can use to find out the status. There are three options - use the helper CGI script, use extinfo.cgi, or look at the local status.log file (Nagios 1.x only). The following are examples - set the URLs and paths appropriately for your system.
Using http and the default CGI paths:
SET nagios_host nagios.mydomain.co.uk
Using normal CGIs but at nonstandard locations:
SET nagios_extinfo http://nagiosserver/nagios/cgi-bin/extinfo.cgi
Using local nagios.log file:
SET nagios_logfile /usr/share/nagios/log/nagios.log
Using helper cgi script on Nagios server
SET nagios_helper http://nagiosserver/cgi-bin/helper.cgi?host=
If authentication is required, you will need an additional two options set:
SET nagios_username username
SET nagios_password password