Page 1 of 1
Arbitrary sensors and custom web tags
Posted: Mon 06 Jan 2025 2:29 pm
by jpsc
I have for some years been using the local river level gauge to update my web pages accordingly.
The level only changes a few times per day and so I have been running a cron job to download the latest csv and parse the current level. This then feeds into a sed script to modify the CMX template files. I am quite happy with this, the overhead is negligable
I would like to feed this number into CMX in a more official way, and publish a web tag like <#Mordiford-riverlevel>
Is there an easy way to create such a tag and populate it from outside CMX?
This has been prompted in part by the Bluesky.txt template which is only loaded when CMX starts, and so my cron edits are not picked up until the next CMX restart
Re: Arbitrary sensors and custom web tags
Posted: Mon 06 Jan 2025 3:55 pm
by mcrossley
One way of doing it...
Save the river level text to a text file called "currentconditions.txt" in the root folder of CMX, then you can use the web tag <#currcond> to pull the contents of that file.
You can also view/edit the content of the file via the Current Conditions editor.
Re: Arbitrary sensors and custom web tags
Posted: Mon 06 Jan 2025 6:11 pm
by jpsc
Great! that works really well
Re: Arbitrary sensors and custom web tags
Posted: Mon 06 Jan 2025 9:29 pm
by HansR
Would it be possible to eliminate/forbid/ignore images in signatures?
I think it is bad, very bad, practice on a forum as it kills transparency of reading the posts.
Re: Arbitrary sensors and custom web tags
Posted: Mon 06 Jan 2025 10:45 pm
by freddie
I expect it is possible. Or perhaps restrict the size. I'll have a think/search.
Re: Arbitrary sensors and custom web tags
Posted: Tue 07 Jan 2025 8:24 am
by HansR
freddie wrote: ↑Mon 06 Jan 2025 10:45 pm
I expect it is possible. Or perhaps restrict the size. I'll have a think/search.
Thanks.
Re: Arbitrary sensors and custom web tags
Posted: Tue 07 Jan 2025 9:19 am
by jpsc
HansR wrote: ↑Mon 06 Jan 2025 9:29 pm
Would it be possible to eliminate/forbid/ignore images in signatures?
I think it is bad, very bad, practice on a forum as it kills transparency of reading the posts.
Apologies, I'll reduce it to a thumbnail. What would be an acceptable size?
Re: Arbitrary sensors and custom web tags
Posted: Tue 07 Jan 2025 12:20 pm
by HansR
jpsc wrote: ↑Tue 07 Jan 2025 9:19 am
HansR wrote: ↑Mon 06 Jan 2025 9:29 pm
Would it be possible to eliminate/forbid/ignore images in signatures?
I think it is bad, very bad, practice on a forum as it kills transparency of reading the posts.
Apologies, I'll reduce it to a thumbnail. What would be an acceptable size?
Well, I still think it is quite large - I think some banners are a bit too large as well - but I'll leave it to @freddie to decide.
Re: Arbitrary sensors and custom web tags
Posted: Tue 07 Jan 2025 1:21 pm
by jpsc
Unfortunately it is the only publicly accessable lower res image that I have on the web
I have the ability to create any arbitrary image on my site, but it is http:// and so not allowed on here
Re: Arbitrary sensors and custom web tags
Posted: Tue 07 Jan 2025 3:49 pm
by broadstairs
I've never been a fan of large images/banner in signatures I prefer text and on a website like this more detail about your station etc to my mind is preferable and useful. It used to be that images slow things down for low bandwidth users but that rarely applies now,however it is more about taking up space in the forum with irrelevant data which, on a help forum like this, is required to describe issues and fixes.
Just my personal view.
Stuart