Author Topic: Can I modify the displayed data read from a WeatherLink tag?  (Read 676 times)

0 Members and 1 Guest are viewing this topic.

Offline raindog

  • Member
  • *
  • Posts: 4
Can I modify the displayed data read from a WeatherLink tag?
« on: October 10, 2018, 11:56:02 PM »
On a weather page I just made (actually a heavily edited WeatherLink template), the two wind speed readings on my page have a decimal and a zero after the whole number. They always display a zero and never the actual value so I would like to remove the decimal point and zero if possible or make it round the number off. Is there a way to do this? My station on WeatherLink's bulletin page doesn't display the decimal and tenths. The tag is
<!--windSpeed-->.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 336
    • LexMAWeather
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #1 on: October 11, 2018, 09:47:06 AM »
Link?

Offline raindog

  • Member
  • *
  • Posts: 4

Offline R_o_B

  • WxElement panel
  • Member
  • *****
  • Posts: 46
    • Tzouhalem-Maple Bay Weather
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #3 on: October 15, 2018, 11:14:37 AM »
Which programming language is used by the template? Is the template written in PHP?
R_o_B
---
eMail: weather@tzweather.org

Offline raindog

  • Member
  • *
  • Posts: 4
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #4 on: October 15, 2018, 11:35:41 AM »
It's not PHP. I think it's Java. I really don't know how to build pages. I just know enough to make some changes to existing pages by making comparisons to existing html and searching for answers.

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7076
    • Eagle Bay Weather
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #5 on: October 15, 2018, 03:37:46 PM »
You need to modify the .htx file in Weatherlink.  That is used to generate the HTML.  There are several ways to format numbers; JS is the best bet I'd think.

Offline raindog

  • Member
  • *
  • Posts: 4
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #6 on: October 15, 2018, 05:40:19 PM »
The htx file is the one I've been working with. Weather Tracker uses the tag below which has number formatting in it but I don't know if WeatherLink allows that.

<td class="data"><!-- wxdata type=wspd unit=mph format="##0.0" --> mph</td>

I've tried to add the number format part and variations of it to WeatherLink's tag but it wouldn't display any reading. I don't know if WeatherLink's tags allow other things to be added within the tag. The line below is the WeatherLink tag I'm working with.

<span class="auto-style14"> <!--windSpeed--></span>&nbsp;Mph</span>

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7076
    • Eagle Bay Weather
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #7 on: October 15, 2018, 11:08:31 PM »
I'm not familiar with Weather Tracker, but it appears to have its own syntax.  You can't use that unless it is in the compiler's approved list.  You would have to embed Javascript (or some other processing language) into the HTX so that it is rendered properly in the HMT file. 

Or dump a text file to your server and process that file.

Offline beteljuice

  • the beteljuice
  • Member
  • *
  • Posts: 15
Re: Can I modify the displayed data read from a WeatherLink tag?
« Reply #8 on: October 16, 2018, 12:39:02 AM »
Try:
Code: [Select]
<script>document.write(parseInt(<!--windSpeed-->));</script>In your .htx file
Imagine what you will KNOW tomorrow !