mailto: blog -at- heyrick -dot- eu

Tea limping back to life.

This morning was time taken writing a parser, getting annoyed at all the edge cases, and rewriting the parser only this time doing it better. ☺

Then I mowed the grass.

Then I spent far too long getting nonsense results with the programme time offsets. It wasn't until I started reading the CLib header files that I discovered that mktime() has a flaw. It will take a time structure (years, months, days, hours, minutes, and seconds) and convert it to a ctime (seconds since the start of 1970). But it will also assume that the provided time is in your local timezone and it will translate accordingly, returning a "calendar time" that represents the given values.
Since RISC OS is open source with a permissive licence, I just pulled the code for mktime() from the library, deleted the five(ish) lines of code that did the timezone shenanigans, and then pasted it into my "utils" source as mkgmtime(). Now I have something that will translate a time structure to time value without messing with it.
Some systems provide a function like timegm() (Linux) or _mkgmtime() (Windows). Alternatively you can set the tm_isdst in the structure to control time fudging. RISC OS, however, is too old and cranky to support any of that.

And I am old and cranky after beating my head against the keyboard over weird times that turned out to be the only way to translate a time struct to a time value quietly messing with it...

Anyway, this is a limited and potentially quirky (fancy word for "might blow up on you") version of Tea that works with the new style EPG.

It looks like this.

A screenshot of Tea with highlighting
What's on TV this evening.

The grey/white alternating pattern is as it always was. The cream to highlight scheduled programmes, as it always was.
What's new now is that sports programmes are shown in green, and movies are shown in yellow (but I think it's a little jarring, so I might rearrange the colours to have orange/yellow/cream be for the scheduler, and cyan for the movies - what do you think?).

You may notice some channels (looking at you Talking Pictures) do not indicate that movies are movies. This is because that metadata is not being set, or isn't being set correctly. So don't 100% rely on it, though it's nice to have a visual representation for those channels that do support it.

Currently Tea is hardwired to UK time and the BBC London region. Additionally there are no programme descriptions (as these now need to be fetched on an as-wanted basis).

Note that the scheduler will display things in your local time, so the notifications happen at the right time for you - you will only notice this if you're living in a non-UK timezone as the times won't appear to match up. This is normal as it is giving the time for you.
Though, this hasn't been tested with winter time yet. ;)

The iCal file exported by Tea always has everything in GMT and leaves it to your calendar software to translate appropriately.

There's more to do, but in my (admittedly not intense) testing, the main EPG and the scheduler appear to work. And it's a lot friendlier to use (especially on RISC OS!) than the website.
And as for tvguide.co.uk, they're yet another of the sites that have decided to go into the "pay us or let our 1265 technology partners track you". I could have sworn the EU and the ePrivacy directive were quite clear that our privacy was not for sale, but since not only is nobody stamping down on this but some of the relevant agencies (like France's CNIL) are actively supporting this crap. So, in the long run, everything gets more and more enshittified thanks to the lack of ethics of advertisers spreading like an electronic cancer.
That's not to say I expect it all for free, but there are - strangely enough - ways to provide non-targetted adverts to users. But, hey, you don't get to track 'em across the web like that so there's no kerching in it...

Download tea_0-25a.zip (471.68K)
For RISC OS machines

 

 

Your comments:

Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺
As of February 2025, commenting is no longer available to UK residents, following the implementation of the vague and overly broad Online Safety Act. You must tick the box below to verify that you are not a UK resident, and you expressly agree if you are in fact a UK resident that you will indemnify me (Richard Murray), as well as the person maintaining my site (Rob O'Donnell), the hosting providers, and so on. It's a shitty law, complain to your MP.
It's not that I don't want to hear from my British friends, it's because your country makes stupid laws.

 
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.

John, 18th October 2025, 20:08
I keep thinking this is about real tea, of which I am fond.
Rick, 18th October 2025, 20:33
I am fond too, that's why it's called Tea and has a teacup as it's icon. 😉
Pete, 19th October 2025, 15:37
As a tea drinker and a Tea user, thanks for making it work again. As for being hardwired to the London region, so is my TV aerial so that's fine also! As for your woes with unix date time stuff, I have emailed you the 
simplest conversion functions ever. Full of very magic numbers.
Rick, 19th October 2025, 22:33
I'll take your magic numbers and raise you this mess: RISC OS source → Lib.RISC_OSLib.c.time (and time() is here for the fun of bashing RISC OS time into ctime). 
 
I can't help but feel that the CLib version is safer with bogus values. Oh, and 0 is *Thursday*?!?
Pete, 20th October 2025, 12:59
Ah, Thursday was unix day 0. So that on the third day it would be the weekend and the creator's could put their feet up.
Rick, 20th October 2025, 14:10
Proof, therefore, that it's easier to bake an operating system than a universe. 😉
Dentarthurdent, 2nd November 2025, 09:53
I never could get the hang of Thursdays.

Add a comment (v0.12) [help?] . . . try the comment feed!
Your name
Your email (optional)
Validation Are you real? Please type 95783 backwards.
UK resident
Your comment
French flagSpanish flagJapanese flag
Calendar
«   October 2025   »
MonTueWedThuFriSatSun
  1345
6910
1417
2024
2728293031  

(Felicity? Marte? Find out!)

Last 5 entries

List all b.log entries

Return to the site index

Geekery
 
Alphabetical:

Search

Search Rick's b.log!

PS: Don't try to be clever.
It's a simple substring match.

Etc...

Last read at 15:48 on 2025/11/15.

QR code


Valid HTML 4.01 Transitional
Valid CSS
Valid RSS 2.0

 

© 2025 Rick Murray
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.

 

Have you noticed the watermarks on pictures?
Next entry - 2025/10/19
Return to top of page