Author Topic: AJAX webpages are underway  (Read 12243 times)

tigers

  • Gentle Breeze
  • **
  • Posts: 79
AJAX webpages are underway
« on: March 12, 2012, 12:51:29 AM »
I've begun work on a new template that incorporates javascript to have certain data updated in real-time. I don't have much to show thus far, but you can see the basic framework for a real-time dashboard (updates at every 5 seconds) that includes temp, pressure, and rain here: http://wx.atkinsfamily.org/indexjq.php

This seems to work on Safari, Firefox, Chrome, and iOS.

Like I said above, this is just the very basics right now, but I'm hoping to evolve this into something pretty cool. Gauges are on the list, but to be honest I'm not really a "gauge" guy. Just give me the number and I'm all set. Now graphs, that's another matter altogether. I've found a couple cool looking possibilities for graphs but that's a bit further down the road..

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1333
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2017 27" iMac 3.8 GHz i5, 40GB RAM, Mac OS 10.14, WeatherCat 3
Re: AJAX webpages are underway
« Reply #1 on: March 12, 2012, 01:09:49 AM »
Very cool, Todd! Thanks for taking on this project.

Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 • WU: KOHAVON11 • AWEKAS • CoCoRaHS • Skywarn •  UK Met Office
MWWN •PWSweather • WeatherBug • WeatherCloud • Twitter • Facebook

Administrator

  • Administrator
  • Gentle Breeze
  • *****
  • Posts: 94
Re: AJAX webpages are underway
« Reply #2 on: March 12, 2012, 08:44:58 AM »
Nice work Todd!

Cheers,
Stu.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 5295
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Tiger in your tank . . . . (Re: AJAX webpages)
« Reply #3 on: March 12, 2012, 09:11:50 PM »
Howdy WeatherCat fans,  .. . .

I've begun work on a new template that incorporates javascript to have certain data updated in real-time.

Hurrah!!  [bounce]  Thanks Tiger!!  [cheer]

See what happens when you put a  ;) tiger in your tank!  [lol2]

Cheers, Edouard  [cheers1]

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #4 on: March 12, 2012, 10:32:50 PM »
Looks very professional, far better than he primitive live display I have on my website.

I'm hoping there is going to be a metric version  ;)

Tony

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #5 on: March 12, 2012, 11:13:58 PM »
Looks very professional, far better than he primitive live display I have on my website.

I'm hoping there is going to be a metric version  ;)

Tony

Funny you should say that! I'm working on a way to set SI units now. I just gotta figure out if the cgi output from LWC is always in imperial units or not. It looks like this is the case but I just need to ask Stu to verify.

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Re: AJAX webpages are underway
« Reply #6 on: March 12, 2012, 11:50:33 PM »
Very slick! I wish I knew more Javascript. Looking forward to the final result.

For SI units, I'm thinking you could get the php file to output two .txt docs, one for imperial, one for SI (just converting the variables).

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #7 on: March 12, 2012, 11:57:53 PM »


Funny you should say that! I'm working on a way to set SI units now. I just gotta figure out if the cgi output from LWC is always in imperial units or not. It looks like this is the case but I just need to ask Stu to verify.

Always Imperial I'm afraid, hence the rather messy conversions on my site.

I'm looking forward to seeing it done properly  [wink]

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #8 on: March 13, 2012, 12:10:43 AM »
Very slick! I wish I knew more Javascript. Looking forward to the final result.

For SI units, I'm thinking you could get the php file to output two .txt docs, one for imperial, one for SI (just converting the variables).

I'm converting the units in js since I'd rather just output one file. I'm thinking this might be slightly easier on the server since the xml file is getting updated every 5 seconds. Besides, we all have multi-core computers now so I figure might as well use some of those cycles for client-side arithmetic!

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Re: AJAX webpages are underway
« Reply #9 on: March 13, 2012, 12:19:29 AM »
True (also I meant to write xml, not txt).  It's probably more user friendly to allow the user to select the units on their end (and have the conversion happen on their side).

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #10 on: March 13, 2012, 02:31:20 AM »
Ok, I've got all the real-time variables available from WC (via the CGI panel) being read into a webpage via Ajax. I've also implemented a switch whereby one can switch between SI and Imperial units on the fly. The default is hardcoded into the page so if you use this template, you can just update that variable to either "c" or "f" depending on what you want the default to be.

http://wx.atkinsfamily.org/indexjq.php

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #11 on: March 13, 2012, 11:22:57 AM »
Looks great, very professional.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 5295
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Nifty!! (Re: AJAX webpages)
« Reply #12 on: March 13, 2012, 04:23:06 PM »
Howdy Todd (aka Tigers), Tony,  and WeatherCat fans,

Ok, I've got all the real-time variables available from WC (via the CGI panel) being read into a webpage via Ajax.

ditto on Tony's observation!  [tup]

Certainly amazing how something as seemingly simple as this brings an immediacy to weather at a remote location!

Thanks again for taking this on Todd!  [spin]

Cheers, Edouard  [cheers1]

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #13 on: March 16, 2012, 07:41:12 AM »
Coming along nicely  [tup]

Is there a reason you have decided to go with metres a second instead of km/hr in the metric version?

Tony

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #14 on: March 16, 2012, 04:33:47 PM »
Coming along nicely  [tup]

Is there a reason you have decided to go with metres a second instead of km/hr in the metric version?

Tony

No reason in particular. I'll switch it over to kph tonight.