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

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #45 on: April 18, 2012, 08:44:42 PM »
Yeah, I'm still not following. Send me a link again to your pages and let me see how you have it setup. The wunderground stuff gets updated ONLY on a manual page refresh and is not affected by the cgi settings in WC.


OK, maybe I didn't write what I meant. ;)

I still have the Custom CGI set to update every 5 seconds so that I have near real-time current conditions from WeatherCat to the web site. Because of this, I quickly use up the 500 Weather Underground requests per day.

What I was asking, was is there a way to *not* request updates from WU every 5 seconds.

The second part of my question, was that if there isn't a way to do what I'm asking above, then I will set the Custom CGI to 3 minutes (480 requests a day.) If I do that, can I send the wxtags every few seconds via the "additional files" section of the Custom Web tag.

If neither of the above, then I'll just set the Custom CGI at 3 minutes and not have the real-time current conditions.

Hopefully that makes more sense.

Thanks,
Steve

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #46 on: April 18, 2012, 10:33:42 PM »
The wunderground stuff gets updated ONLY on a manual page refresh and is not affected by the cgi settings in WC.

Oh! I've had it running two days and received email from WU twice that I've exceeded my allotted 500, and used on of the "raindrops", which seem to be free passes for one day's over use. I've got one magic bean, err, raindrop left.

The test of ajaxeline is at http://www.avon-weather.com/live.php









Those are all the settings.
I changed the "about.php" by changing my iMac for your Mini, but that doesn't change anything.
I changed the name index.php to live.php in order to avoid confusion with my own home page.
I changed the header.php to make the site name a link back to my home page.



And on the index.php (my live.php) file, I added the following below the footer. This is my own disclaimer and the script for GoSquared analytics.

Code: [Select]
</div> <!-- End Footer !-->

<BR>
<BR>

<I>avon-weather.com is privately owned and operated, and is not affiliated with the City of Avon, Ohio, or any business or governmental entity.This data is provided as a hobby from a personal weather station, and while regularly <A HREF="http://weather.gladstonefamily.net/site/D8454" TARGET="_blank" onMouseOver="status='MADIS'; return true;" onMouseOut="status=''; return true;">verified for accuracy</A>, you should not base important decisions on this or any weather information obtained from the Internet. For the most current and accurate weather information for your area tune to your local TV or Radio Stations or your official <B><A HREF="http://www.weather.gov/" TARGET="_blank">National Weather Service</A></B> forecast.

<!--- End Discalimer --->


<BR><BR>

<div style="text-align: center;">copyright 2011-2012, avon-weather.com &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A title ="Email" HREF="mailto:admin@avon-weather.com">Email <img border="0" alt="" src="images/email.gif" width="16" height="16"/></A> | <a title="Mobile" href="/ipwx_Cam.html">Mobile <img border="0" alt="" src="images/mobile.gif" width="16" height="16" /></a> | <a href="http://twitter.com/avonweather" title="Twitter" target="_blank">Twitter <img border="0" alt="" src="images/twitter.png" width="16" height="16" /></a> | <a href="http://www.facebook.com/avonweather" title="Facebook" target="_blank">Facebook <img border="0" alt="" src="images/facebook-icon.png" width="16" height="16" /></a><BR>
<BR>
External Links: This site contains links to other sites. avon-weather.com is not responsible for the content of such web sites.<BR>
</div>

<script type="text/javascript">
    var GoSquared={};
    GoSquared.acct = "GSN-940458-Y";
    (function(w){
        function gs(){
            w._gstc_lt=+(new Date); var d=document;
            var g = d.createElement("script"); g.type = "text/javascript"; g.async = true; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js";
            var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s);
        }
        w.addEventListener?w.addEventListener("load",gs,false):w.attachEvent("onload",gs);
    })(window);
</script>

I can't see how anything that I've done would trigger a call to WU so frequently. I'm only showing 115 hits on my whole site this week, so it has to be something I'm doing.

Thanks for any help, Todd. I know just enough about some of this stuff to get myself in trouble. Again...
Thanks
Steve

Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #47 on: April 18, 2012, 10:45:28 PM »
Yeah I don't see anything there that would cause those wunderground refreshes. I'll look some more tonight and see what I come up with. For what it's worth, I've not hit the max at all on my site.  If you go to http://www.wunderground.com/weather/api/ there's a dashboard where you can see you're usage. It's possible that the radar gif is generating a hit for each frame but the api is not well documented just yet to be sure. Try opening up radar.php and changing the

Code: [Select]
num=10

to say 5 and see if that helps. It'll make your radar animation a little "chunkier" but in theory it's 1/2 the size of the current radar request.

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #48 on: April 18, 2012, 11:57:07 PM »
Arrrg! What an idiot! (Again...)

It probably would help if I'd read the reason I'd gotten the email a little better. I exceeded my rate as noted. But it wasn't the daily rate but the queries per minute. Max is 10 and having the setting at 5 seconds, I was hitting it 12 times every minute. I just changed it to 6.1 seconds and I should be golden.

Again, sorry for leading you astray trying to chase down something that I wasn't describing properly.  [banghead] Thanks for the link, as that's what set me straight.
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

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 #49 on: April 19, 2012, 12:18:14 AM »
I've also received an email from WU stating I have exceeded my daily paid for usage.
Not sure how that was achieved, I'm not even using their radar as they don't have one for here down-under. That was 2 days ago and haven't received  a notice since.

I have discovered one little issue when running in metric, the pressure readings in both the long and short term stats are showing in ' " ' rather than mb, (which I've changed to hPa  ;) ), I manually adjusted them in various daily, weekly etc files and now show the correct units. All other measurements showed the correct metric units and "Today's" readings show the correct pressure units.

I've has some very positive comments about the web template, keep up the good work  [rockon]

Tony

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #50 on: April 19, 2012, 12:33:12 AM »
I've also received an email from WU stating I have exceeded my daily paid for usage.
Not sure how that was achieved, I'm not even using their radar as they don't have one for here down-under. That was 2 days ago and haven't received  a notice since.

I have discovered one little issue when running in metric, the pressure readings in both the long and short term stats are showing in ' " ' rather than mb, (which I've changed to hPa  ;) ), I manually adjusted them in various daily, weekly etc files and now show the correct units. All other measurements showed the correct metric units and "Today's" readings show the correct pressure units.

I've has some very positive comments about the web template, keep up the good work  [rockon]

Tony

Glad you like it. I'll get those units fixed for the next release. I've got a bead on a way to perhaps reduce the requests to WU, but I don't know if it's going to work or not.


tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #51 on: April 19, 2012, 12:38:56 AM »

I have discovered one little issue when running in metric, the pressure readings in both the long and short term stats are showing in ' " ' rather than mb, (which I've changed to hPa  ;) ), I manually adjusted them in various daily, weekly etc files and now show the correct units. All other measurements showed the correct metric units and "Today's" readings show the correct pressure units.


Tony

Oh, and unfortunately we don't see fit to use metric around here...
So perhaps a silly questions, is "hPa" preferred over "mbar" for the units on pressure?

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 #52 on: April 19, 2012, 12:47:11 AM »
hey tigers
a question about the below

is the data updated according to the interval you mention below or is updated according to what the customer cgi setting is in weathercat?
what is the difference between the two?

i have wctags.php file process and uploaded every hour as its not really real time stats and it reduces the amount of ftp traffic but i am not sure how the CGI update affects everything.

Not sure I quite follow.

The template doesn't poll wunderground continuously--it only updates when one manually refreshes the page (or that's the idea anyway). If I've got some weird code in there that's autorefreshing wunderground, I'd love to know so I can take it out!

As for the realtime data, look in wcfunctions.php and look for the line

Code: [Select]
setInterval(getData, 2500);

Note the 2500 in there is the refresh time for the ajax data in milliseconds. So the above tells the getData function to run every 2.5 seconds. You can change that around to suit your needs. 10 seconds = 10000, 1 minute = 60000, etc.

Todd,

Is there an easy way to make the template only poll WU once every five minutes, no matter what I have the CGI set at? I'd like the current conditions from WeatherCat be true up to the second information, while the forecast, maps, and alerts from WU don't need updated so often.

Or vise versa, having the CGI setting control WU every five minutes, but have WeatherCat's "additional files" under Custom Web update the wctags more frequently?

Just wondering and experimenting.
Thanks,
Steve

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #53 on: April 19, 2012, 01:24:55 AM »
The CGI setting in WC ultimately controls the timing of the real-time stats. All my function does is specify how often the data is read from the file generated by WC cgi. For example, I have my CGI settings set to update every 5 seconds, but I query the file on the server every 2.5 seconds.

hey tigers
a question about the below

is the data updated according to the interval you mention below or is updated according to what the customer cgi setting is in weathercat?
what is the difference between the two?

i have wctags.php file process and uploaded every hour as its not really real time stats and it reduces the amount of ftp traffic but i am not sure how the CGI update affects everything.

Not sure I quite follow.

The template doesn't poll wunderground continuously--it only updates when one manually refreshes the page (or that's the idea anyway). If I've got some weird code in there that's autorefreshing wunderground, I'd love to know so I can take it out!

As for the realtime data, look in wcfunctions.php and look for the line

Code: [Select]
setInterval(getData, 2500);

Note the 2500 in there is the refresh time for the ajax data in milliseconds. So the above tells the getData function to run every 2.5 seconds. You can change that around to suit your needs. 10 seconds = 10000, 1 minute = 60000, etc.

Todd,

Is there an easy way to make the template only poll WU once every five minutes, no matter what I have the CGI set at? I'd like the current conditions from WeatherCat be true up to the second information, while the forecast, maps, and alerts from WU don't need updated so often.

Or vise versa, having the CGI setting control WU every five minutes, but have WeatherCat's "additional files" under Custom Web update the wctags more frequently?

Just wondering and experimenting.
Thanks,
Steve

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 #54 on: April 19, 2012, 02:37:21 AM »
Oh, and unfortunately we don't see fit to use metric around here...
So perhaps a silly questions, is "hPa" preferred over "mbar" for the units on pressure?

We only use hPa down here, I know some countries use kPa and others still use mbar . Not much help I'm sorry.
Even before New Zealand went metric in the 70's we used mbar rather than inches.

On another subject, I seem to be missing the about.php used for the "Colophon" tab

Tony

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #55 on: April 19, 2012, 02:41:58 AM »
Ok, thanks for the info. I attached about.php here for you.

Oh, and unfortunately we don't see fit to use metric around here...
So perhaps a silly questions, is "hPa" preferred over "mbar" for the units on pressure?

We only use hPa down here, I know some countries use kPa and others still use mbar . Not much help I'm sorry.
Even before New Zealand went metric in the 70's we used mbar rather than inches.

On another subject, I seem to be missing the about.php used for the "Colophon" tab

Tony

Tornado Tim

  • Strong Breeze
  • ***
  • Posts: 125
    • Matangi Weather
  • Station Details: Davis VP2 with Solar and WLIP Datalogger (via VVP)
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #56 on: April 19, 2012, 02:54:30 AM »
First of all, fantastic work on this template!

However on a web development prospective, there are a few problems:

If Javascript is turned off the page doesnt "fallback" nicely, this is mainly because Javascript is handling the DOM manipulation and Page segmentation.

Google Search Ranking and pages: It seems there is only 1 page that will be indexed due to all the data being put on one page and being segmented by JS only, Googlebot doesnt use javascript to render page it simply reads html.

The problem with this is there will be no other pages for googlebot to refine a persons search specifically (as you have multiple data sets on one page), which will eventually mean that google will start to drop your sites ranking.

I am not saying this for people to avoid using the template, just take into consideration what will happen if or when you do use this web template.


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 #57 on: April 19, 2012, 04:01:04 AM »
hPa is the way to go in my opinion. At least that's what I'm used to.

Thanks again for the awesome template.

Once the little bugs already mentioned are ironed out it will be a fairly straight forward template to set up which is a great for people like me who are not that good with coding.



I have discovered one little issue when running in metric, the pressure readings in both the long and short term stats are showing in ' " ' rather than mb, (which I've changed to hPa  ;) ), I manually adjusted them in various daily, weekly etc files and now show the correct units. All other measurements showed the correct metric units and "Today's" readings show the correct pressure units.


Tony

Oh, and unfortunately we don't see fit to use metric around here...
So perhaps a silly questions, is "hPa" preferred over "mbar" for the units on pressure?

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 #58 on: April 19, 2012, 11:21:52 PM »
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...

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #59 on: April 20, 2012, 01:31:38 AM »
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?