Quote: Originally Posted by
veetid 
this is the case, but we fixed the feed in RC3, it should be working for everyone unless they have old files on the machine somehow...
david
Can you fixed the feed in plugin for version 1.2 ?
I made a solution for CFWeather plugin to show weather at current position.
At following address
http://www.batchgeocode.com/lookup/ I found latitude and longitude for every city.
I am from Romania.
At following address
http://weather.yahoo.com/regional/ROXX.html , I found all cities from Romania that have informations on weather.com
I created the file weather.ini:
Quote:
[Arad]
cod=ROXX0024
lat=46.18026
lon=21.323225
[Bacau]
cod=ROXX0023
lat=46.48000
lon=26.22000
[Botosani]
cod=ROXX0018
lat=47.741155
lon=26.667415
[Braila]
cod=ROXX0001
lat=45.27112
lon=27.956545
[Brasov]
cod=ROXX0002
lat=45.64235
lon=25.58841
[Bucharest]
cod=ROXX0003
lat=44.4342
lon=26.102955
[Buzau]
cod=ROXX0004
lat=45.15534
lon=26.817075
[Calafat]
cod=ROXX0042
lat=43.5800
lon=22.5600
[Calarasi]
cod=ROXX0032
lat=44.196515
lon=27.33539
[Campina]
cod=ROXX0005
lat=45.106151
lon=25.745557
[Caransebes]
cod=ROXX0026
lat=45.409137
lon=22.220693
[Ceahlau Toaca]
cod=ROXX0021
lat=46.97751
lon=25.94994
[Cluj-Napoca]
cod=ROXX0022
lat=46.770135
lon=23.596885
[Constanta]
cod=ROXX0034
lat=44.17694
lon=28.65321
[Craiova]
cod=ROXX0007
lat=44.31887
lon=23.80172
[Drobeta Tr. Severin]
cod=ROXX0031
lat=44.6288
lon=22.6517
[Focsani]
cod=ROXX0008
lat=45.69581
lon=27.18407
[Galati]
cod=ROXX0009
lat=45.433265
lon=28.051575
[Gheorgheni]
cod=ROXX0035
lat=46.722382
lon=25.61038
[Giurgiu]
cod=ROXX0010
lat=43.915495
lon=25.97194
[Iasi]
cod=ROXX0020
lat=43.915495
lon=25.97194
[Oradea]
cod=ROXX0019
lat=47.05206
lon=21.938735
[Petrosani]
cod=ROXX0036
lat=45.41259
lon=23.369355
[Pitesti]
cod=ROXX0011
lat=44.850985
lon=24.879774
[Ploiesti]
cod=ROXX0012
lat=44.940618
lon=26.023406
[Prundu]
cod=ROXX0037
lat=44.833302
lon=24.9167
[Rimnicu Vilcea]
cod=ROXX0028
lat=45.105171
lon=24.373249
[Rosiori de Vede]
cod=ROXX0013
lat=44.096085
lon=24.99297
[Satu Mare]
cod=ROXX0038
lat=47.793295
lon=22.876675
[Sibiu]
cod=ROXX0014
lat=45.791681
lon=24.147604
[Sighetu Marmatiei]
cod=ROXX0017
lat=47.926845
lon=23.902035
[Slatina]
cod=ROXX0015
lat=44.4333
lon=24.3667
[Slobozia]
cod=ROXX0016
lat=44.5667
lon=27.3667
[Sulina]
cod=ROXX0030
lat=45.1500
lon=29.6667
[Talmaciu]
cod=ROXX0039
lat=46.599998
lon=21.883301
[Timisoara]
cod=ROXX0040
lat=45.753425
lon=21.223275
[Tirgoviste]
cod=ROXX0041
lat=44.918538
lon=25.480473
[Vf. Omu]
cod=ROXX0025
lat=45.4500
lon=25.4500
I use a function to calculate distance between 2 positions (x1,y1) and (x2,y2):
Quote:
function distance(x1,y1,x2,y2:double):double;
var dx,dy:double;
begin
dx:=abs(x1-x2);
dy:=abs(y1-y2);
result:=sqrt(dx*dx+dy*dy);
end;
If my current position is (lat0,lon0), I calculate distances from current position to all cities from weather.ini file and I chose the city with smallest distance.
For example, if the smallest distance is from my position (lat0,lon0) and Slobozia (lat=44.5667,lon=24.3667) then I overwrite the file "c:\program files\flux media\centrafuse\plugins\weather\config.xml" with following content:
Quote:
<APPCONFIG>
<SKIN>Onyx WS Night</SKIN>
<APPLANG>English</APPLANG>
<WEATHERCODE>%COD%</WEATHERCODE>
<WEATHERCITY>%CITY%</WEATHERCITY>
<AUTODIAL>False</AUTODIAL>
</APPCONFIG>
where %COD% is replaced with "ROXX0016" and %CITY% is replaced with "Slobozia, Romania".