OS/2, eCS & ArcaOS - Technical > Programming

Desktop Weather

<< < (3/5) > >>

Doug Bissett:

--- Quote ---Visit http://openweathermap.org and type your city name "Edmonton", select the right place (if a list with many appear) and look for the address such as http://openweathermap.org/city/5946768 and the numbers at the end (5946768), that's OpenWeathers CityID.
--- End quote ---

Interesting. Going to http://openweathermap.org/ takes me directly to my home location (Sherwood Park, CA). I did have to search to find the CityID, which doesn't seem to be required.


--- Quote ---Yes, it should detect the right location and that is also something that has to be corrected as the script contain links to more than one service to locate the position, but all seem to reply with slightly different JSon structures that I haven't figured out yet. Your tests and help is very much appreciated to help me find out what to change and adjust.
--- End quote ---

Okay, what can I do to help? It appears that going to the web site, using FF, takes me directly to the proper place, while your program takes me to the wrong place. How is that done? Perhaps I can spot the problem by doing it manually.


--- Quote ---Double click on the desktop object and the SmartGuide will open up.
Click next until you reach the tab "Symbols". Copy the link there to you web browser and add "http://" in front and "/01d.png" after. Replace "01d.png" with "01n.png" for the night version, "02d.png", "02n.png" etc. until 23, then jump to "50d.png" and "50n.png".
--- End quote ---

HAH!, I found where the program put the .png files. They are in the root of the drive where I started the program from. That should make it easy to convert them to OS/2 icon files, but I would suggest that they should be in the folder where the program is, or in a sub folder, and not in the root. More later...

Dave Yeo:
Openweather seems to work better for you (Doug and I have the same ISP). The cmd file thinks I'm in Campbell River which is a few hundred kilometers away on Vancouver Island and the web site thinks I'm in London GB.
I'm outside of Vancouver BC.

Doug Bissett:

--- Quote ---HAH!, I found where the program put the .png files. They are in the root of the drive where I started the program from. That should make it easy to convert them to OS/2 icon files, but I would suggest that they should be in the folder where the program is, or in a sub folder, and not in the root. More later...
--- End quote ---

Okay, I converted the PNG files to ICO files. PMView did it in a few seconds, but I had to tweak 4 of them with the icon editor (open, and save them). ZIP file added.

Now, if we can determine why the location is not working, this thing should work with, or without, the PNG desktop support.

I am suspicious that there is a list of locations, that gets downloaded, but there isn't enough room in the list for all of the locations.


--- Quote --- (Doug and I have the same ISP).
--- End quote ---

That really isn't entirely true. Telus owns it, but the BC and Alberta internet access is run as two separate operations.

Jan-Erik Lärka:
Browser vs. script detection:
Our web browsers contain code that allow sites to detect the location in various ways while my script use rexx sockets that only give out the information provided by the script. Please open the script and look at the services hard coded there and try them in your browser and with wGet or cURL.

Pre eCS usage (Warp 4):
What happen when you double click on the desktop icon? I would guess that a command window flash by and then nothing. SmartGuide is included in eCS in a different location than in Warp 4, so that may be the reason. The script has to be adjusted to handle that as well in such case.

Non PNG Desktop:
Yes, it will download the files to the root as a last resort if there's no bigicons folder. Gues one could disable that part all together when there's no bigicons folder.

The script store information to:
I you have one desktop object it will save that to the EA of weather.cmd under weather...something, then next desktop object will be saved to the EA name in weather.cmd such as "newyork" in my example. It seem to overwrite that information if openweather can't detect the location right away.

Jan-Erik

ivan:
Jan-Erik, that is exactly what I see, a blink of something trying to do something.

Now, where do I find the missing/misplaced SmartGuide that is needed?  Once I know where it is I can try some experiments on my next night shift.

One observation.  It might be an advantage if your script asked for some of this information at the beginning.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version