cloudy cloudy

Author Topic: Weather Display Live for the iPhone and Android  (Read 147103 times)

0 Members and 1 Guest are viewing this topic.

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #15 on: January 14, 2010, 07:41:07 AM »
I've got forecast working based on yr.no xml files. It was not easy, but it works in development.
Next release will contain this, with station/location overrides.

Not sure about radar, unless there is a world wide service I can use, I am trying to keep the app generic.

Sietse

Offline jwwd

  • WML testers
  • Posts: 3,692
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Weather Display Live for the iPhone
« Reply #16 on: January 14, 2010, 11:52:38 AM »
Hi Sietse

Would it be possible to implement WXSIM forecast (plaintext-parser.php) - see here:

English: http://www.silkeborg-vejret.dk/vejrudsigt/plaintext-parser.php?lang=en
Danish: http://www.silkeborg-vejret.dk/vejrudsigt/plaintext-parser.php?lang=dk

On my mobile page - I presents the icons from plaintext-parser:
http://mobil.silkeborg-vejret.dk/vejrudsigt.php

Best regards,

Henrik

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #17 on: January 14, 2010, 12:07:31 PM »
Would it be possible to implement WXSIM forecast (plaintext-parser.php) - see here:

I will support yr.no as a general forecast.
My goal is still to make the software such that it only needs static pages on the server - no php, asp or whatever required.

To support local weather forecasts, I will make an option to replace the yr.no forecast with your own forecast page.

Sietse

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #18 on: January 14, 2010, 11:13:22 PM »
Hi,

Version 0.8 is available. Changes:
- forecasts (by yr.no or specify your own url)
- station name / location override
- radar support (you will have to provide a url)
- webcam support (you will have to provide a url)
- a bit of color

Check out the demo at http://sietse.net/iwdl-demo
Download: http://sietse.net/iwdl-latest.tar.gz

Especially, forecasts by yr.no was very hard. It is not possible to directly load a file from a remote site, so I had to do some trickery including JSONP and Yahoo YQL. But it works - still no php or asp required.

A lot of settings have been added; if you are upgrading to make sure to include the following settings into your current iwdl_settings.js (of course with your configuration):

Code: [Select]
// Station name override; iWDL normally uses the station name from the clientraw.txt.
// In case you want another name to show up in the top bar, remove // in the following line:
// settings["station_name"] = "Utrecht";

// Location name override; iWDL normally uses the coordinates from clientraw.txt.
// In case you want another location to show up in the map screen, remove // in the following line:
// settings["location"] = "Utrecht, NL";

// Forecast; possible types:
// yr.no   -- get forecast from yr.no
// url     -- provide your own forecast
settings["forecast"] = "yr.no";

// Where to get the forecast; go to http://yr.no, find the forecast for your location
// and fill in the last part of the url like below (country/county/city).
settings["yr.no"] = "Nederland/Utrecht/Utrecht";

// When 'forcast' set to 'url', fill in the url (it will be shown in an iframe).
// NOTE: You are responsible for a readable iphone page!
// The forecast_from field is shown at the bottom of the forecast screen
settings["forecast_url"] = "http://mobil.silkeborg-vejret.dk/vejrudsigt.php";
settings["forecast_from"] = "Silkeborg";

// If you have radar data, uncomment and set the url in the next line; it is shown in an iframe
// settings["radar"] = "http://buienradar.mobi/";

// If you have a webcam, uncomment and set  the url the next line; it is shown in an iframe
// settings["webcam"] = "http://yoursite.com/webcam.html";

You are advised not to overwrite your current iWDL, but test it somewhere else; then upgrade.
In case of problems, I am sure you will let me know.

Enjoy!

Sietse
« Last Edit: January 15, 2010, 06:02:15 AM by vogon1 »

Offline jwwd

  • WML testers
  • Posts: 3,692
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Weather Display Live for the iPhone
« Reply #19 on: January 15, 2010, 06:41:19 AM »
Hi Sietse

WOW - so many new features. I have it installed and running without any problems here:

www.silkeborg-vejret.dk/iphone/

Thank you very much.

Best regards,

Henrik

Offline Labbs

  • Posts: 361
  • Göteborg, Sweden
    • Lokalt Väder
Re: Weather Display Live for the iPhone
« Reply #20 on: January 15, 2010, 06:58:21 AM »
Looks very nice Sietse,   8)
Here is an updated language file with the new items/fatures translated (to Swedish)

Thanks
/Labbs
« Last Edit: January 15, 2010, 07:50:42 AM by Labbs »

Offline jwwd

  • WML testers
  • Posts: 3,692
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Weather Display Live for the iPhone
« Reply #21 on: January 15, 2010, 07:11:20 AM »
Hi again

Ups forgot to attached my updated Danish language file

Best regards,

Henrik

Offline vit_kopacek

  • Posts: 6
  • Czech Republic
    • Personal website
Re: Weather Display Live for the iPhone
« Reply #22 on: January 15, 2010, 11:38:24 AM »
Hi Sietse,

thank you for new version! I only have one problem with Forecast. - It's something with using diacritical letters in location name.
For instance, this address works on iPhone fine (I'm getting forecast):
http://www.yr.no/place/Czech_Republic/Moravia-Silesia/Opava/
But this address is not working on iPhone:
http://www.yr.no/place/Czech_Republic/Moravia-Silesia/Bruntál/

Maybe the problem with station name Bruntál (letter "á")?

Offline runarbg

  • Posts: 610
  • Drammen, Norway
    • Konnerud weather
Re: Weather Display Live for the iPhone
« Reply #23 on: January 15, 2010, 12:49:54 PM »
Hi Sietse,

This is really great!  :D  I have it up and running (with radar and web cam) here:

www.runarweb.com/iwdl

I have only one question: As you see the web cam picture is a little large. Is it anything to do with that without reducing the size of the original picture (I know that I can scroll)?

I have a new complete Norwegian language file here:

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #24 on: January 15, 2010, 01:00:06 PM »
Maybe the problem with station name Bruntál (letter "á")?

Please try replacing in iwdl_settings.js the á with

%E1

Does that help?

Sietse

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #25 on: January 15, 2010, 01:04:29 PM »
I have only one question: As you see the web cam picture is a little large. Is it anything to do with that without reducing the size of the original picture (I know that I can scroll)?

I think you will have to setup a special page on your site for the iphone (or smartphone in general) with a smaller picture.
The radar and webcam are loaded in an iframe, iwdl cannot control contents in the iframe, you will have to make sure to serve it suitable content.

Sietse

Offline vit_kopacek

  • Posts: 6
  • Czech Republic
    • Personal website
Re: Weather Display Live for the iPhone
« Reply #26 on: January 15, 2010, 01:58:12 PM »
Please try replacing in iwdl_settings.js the á with %E1 Does that help?

Thank you for your prompt reply. But entering this code:
settings["yr.no"] = "Czech_Republic/Moravia-Silesia/Brunt%E1l";
in my iwdl_settings.js is still not working (there is only word "Loading..." on iPhone's Forecast page).

Offline Gavinf

  • Posts: 42
Re: Weather Display Live for the iPhone
« Reply #27 on: January 15, 2010, 02:40:07 PM »
Thanks Sietse for your quick support and the latest version. I have the radar, webcam and forecast up and running at
 http://gavinf.no-ip.com/~Gavin/iwdl/#home
Regards
Gavin

Offline runarbg

  • Posts: 610
  • Drammen, Norway
    • Konnerud weather
Re: Weather Display Live for the iPhone
« Reply #28 on: January 15, 2010, 07:03:56 PM »
Sietse,

I'm not able to run Norwegian and English version on the same iPhone. I have set up a Norwegian version here (Norwegian language and metric units) :

www.runarweb.com/iwdl

and an English version here (English language and US units):

www.runarweb.com/iwdl_e

When running the Norwegian version, everything is fine. If I exit that and start the English version, I get US units but Norwegian language. The strange thing is at startup I see the main screen in English for 0,5 seconds, then it turns Norwegian. That happens each time. I have deleted cookies etc., but still the same.

If I enter Settings, units are US and language is Norwegian. Then I change it to English and everything is fine each time I start the application.

That is until I try the Norwegian version again. There the units are metric now but language is English! (I see Norwegian texts 0,5 seconds at startup).

Do you have any idea what happens?

NB: I tried Firefox on my PC, aqnd there I have NO PROBLEM!

Offline vogon1

  • Posts: 178
  • Utrecht, NL
Re: Weather Display Live for the iPhone
« Reply #29 on: January 15, 2010, 10:13:53 PM »
I'm not able to run Norwegian and English version on the same iPhone.

Do you have any idea what happens?

NB: I tried Firefox on my PC, aqnd there I have NO PROBLEM!

Yes, that is a feature, not a bug. Really.

One of the drives for me to create this application is to develop my javascript skills, and to make sure no server side scripting is required. Not even cookies.
The early versions of iWDL only had settings in iwdl_settings.js; later on I added a settings screen in the application. The settings should persist across sessions, and HTML5 has a feature for that: HTML5 databases. Safari supports this.

So, how does it work?
When a new user visits iWDL on a particular site, say runarweb.com, it does not have settings for this site in the HTML5 database. The settings of iwdl_settings.js will be used. If the user does not change any setting, the database will stay empty. So, if you have an english and a norwegian site with its own settings, switching between iwdl and iwdl_e wil indeed change language because the HTML5 database for iwdl is empty.

Now, the user changes the language to Dutch. Clearly, the user has a preference for that. The setting will be true for the whole site runarweb.com (that is the way I implementated it). So, even when switching from iwdl to iwdl_e, the language will stay Dutch, because it overrules the default setting. That is what the user wanted. The same is true for all other settings.

You can throw away the HTML5 database on your iPhone. Go to Settings -> Safari -> Databases; find www.runarweb.com, database iwdl. In the toolbar, tap Change, now you can delete the iwdl database.

Firefox does not support HTML5 databases, so in my javascript code, I ignore this database stuff. That also means that settings are not preserved between sessions. If I select Dutch using Firefox, and I restart firefox, the language will be back to whatever the default is in iwdl_settings.js.

I just love using new techniques ;)

Sietse

 

cumulus