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

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • 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 #30 on: April 16, 2012, 11:15:05 PM »
Bingo! I deleted everything and started over, and found what I did wrong the first time.

In the instructions it says
Quote
2. Open submit_weather.php and edit the username and password to something of your liking
And that's exactly what I did. I replaced the words ID and PASSWORD with my own ID and password. But that's not what you are opposed to do. You are supposed to replace the really obvious REPLACEME shown twice with your ID and password.

The problems encountered with this template occurred entirely between the seat and the keyboard...

Sorry for all the trouble and thanks for working through it with me, Todd. I sure wouldn't have figured out the HostDime part without you.

Current version is at http://www.avon-weather.com/live.php  Of cours y'all know me; it won't look like this for long! :D

Thanks a lot!
Steve

[EDIT] Except I used my Wunderground daily allotment up in 42 minutes. I guess this isn't meant to be updated every five seconds like my live raw data was!
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 #31 on: April 17, 2012, 01:02:58 AM »
Cool, I'm glad you got it working, and no don't update the WU stuff every 5 seconds or you see what happens. You get 500 requests/day from WU without paying up for their api access.

If you're going to theme it, take a look at http://jqueryui.com/themeroller/ and you can customize your the css from there and then upload the resultants css files and images to your server (see my first post in this thread). You can also try out some of the canned themes as well. Just replace the link in index.php that looks like

Code: [Select]
<link rel="stylesheet" type="text/css" href="./css/ajaxeline.css">

with a line that looks like

Code: [Select]
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/start/jquery-ui.css

And you'll see quite a different looking site. To see the pre-made therems, just go to the themeroller link above and click the "Gallery" tab. Replace the "start" portion of the link above to anything of your liking. E.g. ui-lightness, mint-choc, etc.

Also, seems as if you have a Wind Advisory until 10 PM.

Bingo! I deleted everything and started over, and found what I did wrong the first time.

In the instructions it says
Quote
2. Open submit_weather.php and edit the username and password to something of your liking
And that's exactly what I did. I replaced the words ID and PASSWORD with my own ID and password. But that's not what you are opposed to do. You are supposed to replace the really obvious REPLACEME shown twice with your ID and password.

The problems encountered with this template occurred entirely between the seat and the keyboard...

Sorry for all the trouble and thanks for working through it with me, Todd. I sure wouldn't have figured out the HostDime part without you.

Current version is at http://www.avon-weather.com/live.php  Of cours y'all know me; it won't look like this for long! :D

Thanks a lot!
Steve

[EDIT] Except I used my Wunderground daily allotment up in 42 minutes. I guess this isn't meant to be updated every five seconds like my live raw data was!

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 #32 on: April 17, 2012, 01:04:04 AM »
i've uploaded the about.php file and that has fixed that problem.
i also used HairyMcLeary's tip of removing one of the = in the forecast.php file and now WU forecast shows up in celsius.

but live data is still not metric. data seems to update as the update time on the page changes every 60 seconds (which i have set in the custom cgi tab) but i still get the error in the custom cgi tab. i am using 000webhost so could it be a problem on their side or mine.

i had a look in the curdata.xml file and it is not metric in there...

thanks


edit: i got most of it working but i cant figure out how to get the reading into metric???

also the colophon page has a few errors which i cant figure out

my page is
http://tommo.web44.net/


another issue i am having and i dont know if this is an issue is in the Custom CGI preferances tab in WeatherCar the current status always says Error - Unexpected response from server. is this normal?



any help would be much appreciated

thanks

I've got to head out to work so I don't have any time right now, but it does look like you're missing the about.php file. I've attached it here so just unzip and upload it to your site and it should correct those errors.

As for the "Unexepected response...", that shouldn't be happening. It looks like the real-time data is not uploading to your site just yet. And the metric units should be appearing in your page since that setting is read from wctags.php. It'll be tonight (morning for you!) before I can look into those errors.

Thanks for testing this out for me. Hopefully as the process comes along, things will get easier.

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #33 on: April 17, 2012, 01:05:02 AM »
Thanks for the work you have put into this.

I've managed to get it working ok. There were a few issues with metric, it needed a file to be manually tweaked to get the live data to display in Metric, and WU forecast wouldn't show in metric either. I found a typo in the forecast.php - if ($UNITS == "C") - i took out one of the "=" and the forecast popped up in metric.
I'm not sure i will stick with WU forecast as they are useless down here and they don't have radar maps.

I might play around with some of the colours next.

Thanks again for the great work.

Tony

Yeah, you definitely found a bug there. I'll get it fixed.

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 #34 on: April 17, 2012, 01:46:40 AM »
the wctags.php file is being uploaded to the web server root directory, same as all the other files.
i would really love to get metric working as imperial means nothing to me.

what i also love about this template is that it looks great on all devices, my browser, ipad and iphone which means i will only need the one site.

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #35 on: April 17, 2012, 01:54:29 AM »
Ok, I'm on it. Looks like there's a problem getting the variable from wctags.php to the javascript. I'll post and update when I've got this fixed.

the wctags.php file is being uploaded to the web server root directory, same as all the other files.
i would really love to get metric working as imperial means nothing to me.

what i also love about this template is that it looks great on all devices, my browser, ipad and iphone which means i will only need the one site.

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 #36 on: April 17, 2012, 02:04:45 AM »
thanks heaps

i appreciate the work and help you've given.


tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #37 on: April 17, 2012, 02:23:06 AM »
Try this latest download. I *think* this fixes the issues with metric/imperial units.

http://atkinsfamily.org/weather-templates/

thanks heaps

i appreciate the work and help you've given.

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 #38 on: April 17, 2012, 03:26:53 AM »
looks like the WCTAGS.php file is your processed one so can you send the the unprocessed one.

is the template already configured for metric or will i have to make any changes.

now with the updated one, even my WU forecast is imperial and i managed to get it to metric before...

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 #39 on: April 17, 2012, 03:31:18 AM »
i actually put the old wctags.php in and now i have metric!!! yey

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: Ajaxeline AJAX and PHP template. Beta release available.
« Reply #40 on: April 17, 2012, 04:36:25 AM »
i actually put the old wctags.php in and now i have metric!!! yey

Yeah I grabbed the post processed wctags.php again. If others have this issue, just use the wctags.php posted earlier in this thread.

One of these days I'll quit grabbing the wrong one.

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 #41 on: April 17, 2012, 07:28:17 AM »
thanks for all your help, the site is working nicely but i still cant explain why the CGI tab in WeatherCat continually reports the "Unexpected Response from Server"

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • 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 #42 on: April 18, 2012, 06:12:42 PM »
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
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 #43 on: April 18, 2012, 07:01:30 PM »
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

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • 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 #44 on: April 18, 2012, 07:43:18 PM »
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 - Avon, Ohio, USA


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