Author Topic: Ajaxeline AJAX and PHP template. Beta release available.  (Read 112306 times)

xtommo

  • Gentle Breeze
  • **
  • Posts: 48
  • Station Details: LaCrosse WS2355 on iMac 2.66GHz Intel Core 2 Duo
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #60 on: April 20, 2012, 07:14:58 AM »
The two best providers would be the

Bureau of Meteorology
www.bom.gov.au

or
Weatherzone
www.weatherzone.com.au



Is it possible to replace the radar from a different source as I just realized that the WU radar shows up on the page but it never has any rain on it...

The answer is....maybe. Technically, it's no problem. The issue is whether or not the provider will let you show it on your site.

Who's the preferred source for radar in your area?

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #61 on: April 23, 2012, 02:09:35 AM »
I looked over both those sites, and it looks like they charge for access to their data. Interesting in the case of the government site since the theory is that the taxpayers are already paying for it...

Anyway, you can of course "hotlink" to the radar image from either of those sites, but I suspect they will frown on that. Open up radar.php and replace the line that says

Code: [Select]
<?php echo "<img alt=\"Weather Radar\" class=\"radar\" src=\"http://api.wunderground.com/api/" $WUND_KEY"/animatedradar/q/" $LOCATION ".gif?newmaps=1&amp;timelabel=1&amp;timelabel.y=10&amp;num=10&amp;delay=50&amp;width=900&amp;height=480\" />" ?>

with

Code: [Select]
<img alt="Weather Radar" class="radar" src="http://LINKTOTHERADARIMAGE.COM">

The two best providers would be the

Bureau of Meteorology
www.bom.gov.au

or
Weatherzone
www.weatherzone.com.au



Is it possible to replace the radar from a different source as I just realized that the WU radar shows up on the page but it never has any rain on it...

The answer is....maybe. Technically, it's no problem. The issue is whether or not the provider will let you show it on your site.

Who's the preferred source for radar in your area?

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #62 on: April 26, 2012, 02:31:01 AM »
I've updated the template a little bit. Hopefully this corrects all the issues with switching units and it also adds an iphone optimized page. I'm going to let this bake a little while and if all seems OK, I'll post up a link later this weekend. Have a look and let me know if you see any problems.

http://wx.atkinsfamily.org

and iphone: http://wx.atkinsfamily.org/m.php

Changes:
-Added a way to more easily switch among the available themes. See http://jqueryui.com/themeroller/ and click the gallery tab on the left to see the default available themes.
-Fixed (I hope) the metric/imperial settings
-Added iphone optimized page. This autoredirects so I'd be interested to hear the results from those who run android since I don't have a way to test that. If you've seen my ipwx template, this will look pretty familiar.
-Misc. style updates.
-Switched to microsoft cdn for the jquery, jqueryui, and styles libraries. If this proves too slow, I'll switch back to google. Of course you can always download all these libraries and host them yourself.

xtommo

  • Gentle Breeze
  • **
  • Posts: 48
  • Station Details: LaCrosse WS2355 on iMac 2.66GHz Intel Core 2 Duo
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #63 on: April 26, 2012, 08:46:54 AM »
hey, thanks for the info.
i had a play with it and decided to remove the radar all together and just add a link from the page to the radar page.

i like your new updated page, looks good. cant wait to try it out.


edit: i am now hosting my page on
http://tommo.homeip.net

wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #64 on: April 26, 2012, 06:20:49 PM »
Hi tigers,
I like the iPhone template - is it possible to add a webcam button?
Reinhard


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #65 on: April 26, 2012, 11:40:19 PM »
Hi Todd (aka Tigers, )

I like the iPhone template - is it possible to add a webcam button?

When you have a little free time (assuming ever!  ;D) I would second the motion on this one.  It is really neat to get a quick view of the sky at home while on the go.

Cheers, Edouard  [cheers1]

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #66 on: April 27, 2012, 01:17:53 AM »
Yeah, no problem. I added an image link to the mobile page. I don't use webcams myself so I'll probably be asking for help on those functions as this progresses.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
You are missin' out on the "fun" (Re: Ajaxeline AJAX and PHP template.)
« Reply #67 on: April 27, 2012, 03:20:02 AM »
Hi Todd (aka Tigers),

Yeah, no problem. I added an image link to the mobile page.

Thanks, it is "habit forming" . . . . .  ;D

I don't use webcams myself so I'll probably be asking for help on those functions as this progresses.

 ;) Now wait a minute, that's not fair.  You've gotta get one like the rest of us.  If you don't have those hassles too  [banghead] - that's cheatin'!!   [lol2]

Cheers, Edouard  [cheers1]

xtommo

  • Gentle Breeze
  • **
  • Posts: 48
  • Station Details: LaCrosse WS2355 on iMac 2.66GHz Intel Core 2 Duo
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #68 on: April 30, 2012, 11:18:00 PM »
hi tigers
ive noticed that on my page all wind readings, ie Wind Speed, Wind Gust and the 10min Wind Average readings are always the same... is that something that i've done wrong or is the site not displaying them correctly?

another problem ive found is that the heat index and wind chill are always displaying N/A

http://tommo.homeip.net/

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #69 on: May 01, 2012, 12:10:21 AM »
Hi Tommo,
Interesting, might be a CustomCGI issue - how does the data on your page compare to the data displayed in the Live Data View within WeatherCat?

Cheers,
Stu.

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #70 on: May 01, 2012, 12:52:11 AM »
I've noticed that as well but they do differ from time to time.

Click for large view - Uploaded with Skitch

As for the Heat Index and Wind Chill, those values will read N/A unless certain thresholds are met:

-Heat Index: Temp=>80F and Humidity => 40%
-Wind Chill Temp<=50F and 10 Minute Wind => 5mph

Note that the above values are in imperial but the logic and calculations are done prior to converting the final output to metric units.

The formulas I'm using are:

Code: [Select]
// Calculate the Heat Index. See http://en.wikipedia.org/wiki/Heat_index
function heatindex (t,r)
{
    var t2=Math.pow(t, 2);
var rh2=Math.pow(r, 2);
    return -42.379 + 2.04901523*t + 10.14333127*r - 0.22475541*t*r - 6.83783e-03*t2 - 5.481717e-02*rh2 + 1.22874e-03*t2*r + 8.5282e-04*t*rh2 - 1.99e-06*t2*rh2;
}

// Calculate the Wind Chill. See http://en.wikipedia.org/wiki/Wind_chill
function windchill (t,w)
{
    return 35.74 + 0.6215*t - 35.75*Math.pow(w,0.16) + 0.4275*t*Math.pow(w,0.16);
}


Eventually I'd like to add some logic so that that those boxes can be combined into a single box.

hi tigers
ive noticed that on my page all wind readings, ie Wind Speed, Wind Gust and the 10min Wind Average readings are always the same... is that something that i've done wrong or is the site not displaying them correctly?

another problem ive found is that the heat index and wind chill are always displaying N/A

http://tommo.homeip.net/

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #71 on: May 01, 2012, 02:17:30 AM »
I've uploaded a new version of the template. Hopefully got the metric/imperial bugs fixed. Also made it a little easier to choose your desired theme. Download here: http://atkinsfamily.org/weather-templates/  and you can see the template in action here: http://wx.atkinsfamily.org/

There's also a new iPhone optimized page. If you visit your site on an iPhone (but not iPad), it'll auto redirect you to m.php which is very similar to my previous ipwx template. This page behaves as a "web app" so you can add it to your home screen and it'll get put in there with a nice little icon and everything.

I've also added a drop down box at the top of my page so you can switch the themes and see how the different ones look. Once you find one you like, just edit config.php per the instructions on my page and you'll be good to go.


HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #72 on: May 01, 2012, 04:24:29 AM »
I've noticed that as well but they do differ from time to time.

Click for large view - Uploaded with Skitch

As for the Heat Index and Wind Chill, those values will read N/A unless certain thresholds are met:

-Heat Index: Temp=>80F and Humidity => 40%
-Wind Chill Temp<=50F and 10 Minute Wind => 5mph

Note that the above values are in imperial but the logic and calculations are done prior to converting the final output to metric units.

Eventually I'd like to add some logic so that that those boxes can be combined into a single box.



I've noticed my various wind readings are nearly always the same, but they do vary from the to time.

I had the windchill working yesterday for the first time - 2.7 C  I kind of wish it wasn't, made it feel that little bit colder ;-)

Tony

xtommo

  • Gentle Breeze
  • **
  • Posts: 48
  • Station Details: LaCrosse WS2355 on iMac 2.66GHz Intel Core 2 Duo
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #73 on: May 01, 2012, 06:18:53 AM »
the readings differ from the Live Data view
i have attached a screen capture showing both at the same time.

i cant figure out how they can be all the same readings, when they do differ its only for a few seconds and then they all match up again.

i have installed the latest version and its still the same.

ps. l love how easy you've made it to change the theme. thats awesome

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #74 on: May 01, 2012, 05:10:40 PM »
Interesting, thanks for the screenshot. There may be some latency between what you're seeing in the Live Data View and what's on your web-page depending on the rate you have set in the custom CGI pane of the preferences.

The raw data output on mine here: http://live.trixology.com/watch_weather.php looks fine, but just to be sure, I've raised it as a bug so the code will get looked at.

Cheers,
Stu.