Page 1 of 1

generating weather history for website using realtime.xml

Posted: Tue 14 Jan 2014 12:58 pm
by ace2
I wishing to edit my web site to include realtime figures that are updated every 5 minutes from cumulus, but am at a lose on how to do it??

my web site is http://www.users.on.net/~ace2/index.htm (don't knock it, it's based on cumulus templates that's been edited)

I'm trying to add a page that's simliar to the history from weather undergound (Tabular Weather History) 3/4 down the page

http://www.wunderground.com/weatherstat ... SOUTHAU125

I have already set cumulus to upload the realtime.xml and realtime.txt to my site, now i'm after a template to create the web site..

reatime.txt eg :
14/01/14 23:22:49 27.3 49 15.7 0.0 1.1 45 0.0 0.6 1018.1 NE 0 km/h C mb mm 129.0 0.0 10.2 10.2 0.0 28.8 43 27.3 -0.6 44.3 15:15 26.8 18:34 23.4 16:15 37.8 17:49 1019.6 18:51 1013.8 15:01 1.9.3 1059 1.1 27.6 31.6 0 0.00 0 45 0.0 2 0 0 NE 1449 m 29.2 0.0 0 0

realtime.xml : http://www.users.on.net/~ace2/Realtime.xml

Any help would be great

Re: generating weather history for website using realtime.xm

Posted: Tue 14 Jan 2014 1:19 pm
by steve
Would it be possible to do something with the 'recent history' web tags? http://wiki.sandaysoft.com/a/Webtags#Recent_History

Here's an example of what someone has done using those web tags: http://members.iinet.net.au/~nossis/weather/obs.htm

Re: generating weather history for website using realtime.xm

Posted: Tue 14 Jan 2014 1:54 pm
by mikechristelow
Is what you're trying to do this
wunderground.png
using this perhaps?
wiki.png
(because the realtime.xml uses the realtime.txt file values, which are contunually overwritten and not a log of the kind you'd need?)

Re: generating weather history for website using realtime.xm

Posted: Fri 17 Jan 2014 12:47 am
by ace2
steve wrote:Would it be possible to do something with the 'recent history' web tags? http://wiki.sandaysoft.com/a/Webtags#Recent_History

Here's an example of what someone has done using those web tags: http://members.iinet.net.au/~nossis/weather/obs.htm

That is exactly what i'm after Steve.....

Now the hard work begins.....

*puts newbie hat on*

Re: generating weather history for website using realtime.xm

Posted: Sat 18 Jan 2014 5:49 am
by ace2
Is there a template available for Cumulus to be able to do this????

Re: generating weather history for website using realtime.xm

Posted: Sat 18 Jan 2014 9:11 am
by steve
You could ask 'nossis' (Barry) if he would let you have his? He's a forum user.

Re: generating weather history for website using realtime.xm

Posted: Sun 19 Jan 2014 11:40 am
by ace2
still waiting for a reply, but in the mean time, have been playing around with web tags, able to call data using the <#Recent###### m=##> which works, but how do you get a time and date for event?

eg.
<#RecentOutsideTemp m=30>
gives outside temp 30 mins ago

but using
<#time> will give current date/time, how do you minus 30 mins???? cause the m=30 does work!!!

Re: generating weather history for website using realtime.xm

Posted: Sun 19 Jan 2014 11:44 am
by steve
Use <#RecentTS> as mentioned in the wiki (it's the first one in the table of 'recent history' web tags).

e.g. <#RecentTS m=30> will the give the timestamp of the data from 30 minutes ago. You can use the 'format' parameter to get the date/time format that you want.

Re: generating weather history for website using realtime.xm

Posted: Sun 19 Jan 2014 1:26 pm
by ace2
but how can I get the time format to minus the mins.

11:30pm(current time) and I wish to have the time as current -30 mins.(11:00pm)

using
<#time m=30>
doesn't seem to work
shows 11:30pm m=30 in the output

Re: generating weather history for website using realtime.xm

Posted: Sun 19 Jan 2014 1:43 pm
by steve
Perhaps I'm misunderstanding what you are trying to do. The <#time> web tag doesn't have an 'm' parameter, it always gives the current time. You need to use <#RecentTS> if you want to timestamp the <#Recent....> data values.

At 11.30pm, <#RecentOutsideTemp m=30> will give you the outside temperature at 11.00 pm (or the nearest if that's not available), and <#RecentTS m=30> will give you the date and time 30 minutes ago (actually the date and time corresponding to the data value previously mentioned), using the Windows short time format and short date format. If you just want the time, <#RecentTS m=30 format="hh:nn"> will give you that, i.e "11:00".

Re: generating weather history for website using realtime.xm

Posted: Mon 20 Jan 2014 2:59 am
by ace2
yes I worked that out, silly me had a typo causing it to not work!!!

I'm using the format=t which gives 11:00am. the only other problem I'm having is, the first time comes out with 11:00am and the next line is 10:31am, it seems to add a minute on some how. I'm not sure if I use m=31 or is there an easy way to round the time up/down???

here is the page I'm creating (still in the process of editing, so its still ruff).


http://www.users.on.net/~ace2/obe.htm

Re: generating weather history for website using realtime.xm

Posted: Mon 20 Jan 2014 6:04 am
by ace2
A sample of the webtags i'm using to correct the time issue below :
<tr>
<td><#RecentTS format=t h=7 m=1></td>
<td><#RecentOutsideTemp h=7 m=1></td>
<td><#RecentWindChill h=7 m=1></td>
<td><#RecentDewPoint h=7 m=1></td>
<td><#RecentHumidity h=7 m=1></td>
<td><#RecentWindSpeed h=7 m=1></td>
<td><#RecentWindGust h=7 m=1></td>
<td><#RecentWindDir h=7 m=1></td>
<td><#RecentWindAvgDir h=7 m=1></td>
<td><#RecentRainToday h=7 m=1></td>
</tr>
<tr>
<td><#RecentTS format=t h=7 m=31></td>
<td><#RecentOutsideTemp h=7 m=31></td>
<td><#RecentWindChill h=7 m=31></td>
<td><#RecentDewPoint h=7 m=31></td>
<td><#RecentHumidity h=7 m=31></td>
<td><#RecentWindSpeed h=7 m=31></td>
<td><#RecentWindGust h=7 m=31></td>
<td><#RecentWindDir h=7 m=31></td>
<td><#RecentWindAvgDir h=7 m=31></td>
<td><#RecentRainToday h=7 m=31></td>

I know i'm annoying with all this, but how do i convert/change the #RecentWindDir & #RecentWindAvgDir to show the actual direction and not a number???

eg 101 degrees as ESE

Re: generating weather history for website using realtime.xm

Posted: Mon 20 Jan 2014 7:44 am
by steve
ace2 wrote:the only other problem I'm having is, the first time comes out with 11:00am and the next line is 10:31am, it seems to add a minute on some how. I'm not sure if I use m=31 or is there an easy way to round the time up/down???
Your page looks OK at the moment with the code you're using. I think it's because the web page gets processed just after a new minute starts. It might be a bug.
I know i'm annoying with all this, but how do i convert/change the #RecentWindDir & #RecentWindAvgDir to show the actual direction and not a number???

eg 101 degrees as ESE
Use some javascript. E.g

Code: Select all

<script>
var compassPoints = new Array(
   "N", "NNE", "NE", "ENE", 
   "E", "ESE", "SE", "SSE", 
   "S", "SSW", "SW", "WSW", 
   "W", "WNW", "NW", "NNW");

function windDir($winddir)
{
   return compassPoints[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}   

</script>
And then use

<script>
document.write(windDir(<#RecentWindDir h=7 m=1>) );
</script>

where you're using the web tag.

Re: generating weather history for website using realtime.xm

Posted: Thu 30 Jan 2014 3:34 pm
by nossis
Just stumbled across this post now...
if you still need it and haven't found my source page for observations, grab it from over here.
https://cumulus.hosiene.co.uk/viewtopic.p ... 372#p89372
the last post i uploaded and just updated it then too. :D

Barry

Re: generating weather history for website using realtime.xm

Posted: Thu 30 Jan 2014 9:36 pm
by ace2
All done...

http://www.users.on.net/~ace2/obe.htm

Finally ironed out all my bugs.
had to rebuild the whole template pages due to some mistakes


Thanks