Earth Notes: On Website Technicals (2024-02)

Updated 2024-02-24.
Tech updates: intensity page tweak, new data source and JSON, toot lite, significantLink, square gCO2perkWh, series RSS, Mastodon preview a11y alt text...
Tweaks here and there, with nothing major planned for this month, though I did switch to the Elexon streaming FUELINST JSON data source, which seems more efficient and reliable. There have been several tweaks to better interact with Mastodon when (auto-)tooting articles too.

2024-02-24: A11y: alt Preview Image Text

To improve Mastodon previews of tooted/posted articles I am adding og:image:alt text for each og:image in article page headers.

This can make headers over-long, so is automatically dropped in that case.

I have extended the script/ automatic alt text-from-image-name extractor to be able to use custom text from an .alt.txt file where extant.

2024-02-23: Series RSS Feed

I have now made it easy to make an RSS feed for any page 'series', though for now I have set it up for Site Technicals.

The RSS feed file is created/updated as needed containing all the series pages, most recently updated first, and a link to the series head. Each series page gets built with a link to that RSS feed auto-inserted in the page header for auto-discovery with tools such as Brief, and in the series navigation for humans to discover/click manually.

I have also tentatively set this up for Saving Electricity.

2024-02-24: Desktop only

Just about as the complete site rebuild was finishing I decided that the auto-insertion of RSS links in series pages should probably be restricted to desktop full-fat pages only (not mobile/lite nor offline). Both to save some page weight but also for relevance: the feeds are of the desktop pages, less appropriate for other audiences.

2024-02-22: gCO2perkWh New! Improved! and Square!

By way of reducing Mastodon preview stampede load further from the regular grid intensity postings/toots, and to improve the preview look, I have created a smaller (by bytes and pixels) square og:image:


I have also added an og:image:alt of grid carbon intensity equation.

Except actually it's bigger on all counts! Try again!


This results in a (Mastodon v4.2.7) toot thus:

Screenshot 20240222 new gCO2perkWh sq og image in toot

Old vs new:

7535 17 Sep 12:27 gCO2perkWh-1.png
4478 17 Sep 12:27 gCO2perkWh-1.png.webp
3545 29 Jan 18:08 gCO2perkWh-1.pngL
3484 30 Jan 13:06 gCO2perkWh-1.png.webpL
6883 22 Feb 10:47 gCO2perkWh-sq.png
3870 22 Feb 10:50 gCO2perkWh-sq.png.webp
1780 22 Feb 10:47 gCO2perkWh-sq.pngL
1496 22 Feb 10:50 gCO2perkWh-sq.png.webpL

2024-02-18: significantLink

I have annotated the home-page links to featured and popular articles with significantLink as an experiment. (I have manually annotated one other link also.)

To allow this I additionally now have the home page declare itself to be of the type WebPage.

2024-02-15: Toot Lite When LOW

For once, an idea when falling asleep that turned out to be good... (Though I nearly forgot it entirely.)

When auto-tooting an EOU page to Mastodon, if the battery is LOW then toot the 'lite' (m.) page rather than the full-fat (www.) desktop page. That will use a little less bandwidth etc at the point of tooting and the stampede to read the page, but also subsequently less for anyone actually visiting the page. Plus it shows off that EOU has 'lite' pages.

This will not happen outside of winter months, generally.

The test could be changed to NOTHIGH, at which point some non-daytime toots would be lite too.

2024-02-12: Intensity Data Source Upgrade

Elexon will be turning off the unfashionable BMRS data service at later this year.

In its place is a shiny new API at of which the bit I am interested in (FUELINST) has an endpoint [with] optimised JSON payload and is aimed at frequent requests (datasets/FUELINST/stream) which sounds like the thing that I should use so as to be a good citizen.

After some faffing I have selected the public domain org.json JSON implementation for now, to parse inbound data.

I think that internally I will convert it to the old format for processing and cacheing initially. I can make some quick optimisations such as only requesting data since the last value already held if more recent than 24h.

2023-02-15: JSONed!

By avoiding doing my research and manuscript correction work, I think that I have finished the upgrade to use the new JSON source.

I think that I will keep testing it in the IDE manually, and look for glitches, but it can probably go live in a day or two.

Lots of old commented-out code currently lurks: that should be cleaned up.

I was able to make an optimisation to request far less data from Elexon each time, typically well under an hour's worth even being quite cautious, and this can likely be trimmed further.

2023-02-16: V1.4.0

Initial updated version (not shrunk with Proguard yet) released at V1.4.0.

At the start of the long store the old data nominally arrived in this CSV form from Elexon. At the very end of the long store it is synthesised from JSON.

% gzip -d < _gridCarbonIntensityGB.longstore.csv.gz | head
% gzip -d < _gridCarbonIntensityGB.longstore.csv.gz | tail

2023-02-16: V1.4.1

I fixed the Proguard minified JAR build by fixing the JRE used to run ant and build.xml.

108038 16 Feb 10:44 .work/reutils-1.4.0.jar
 66410 16 Feb 15:44 .work/edhMain.reutils-1.4.1.jar

I trimmed still further the data requested from the Elexon server each time. I am now typically requesting 4 intervals of generation data rather than 287, (~70x down) which feels like a win. Technically 2 of those are still redundant, but I am being cautious and allowing for clock skew and other funnies...

I commented out or removed more historic Twitter support code and libraries. (This de-Twitter-ing process started around 2022-11-11.)

2023-02-17: reliable so far

The have been zero drop-outs in gathered FUELINST data in the approximately 24h the new system has been in place (to 17:00Z). There were three drop-outs on the morning of the 16th under the old system.

20240217 heatBatTarget

2024-02-07: Intensity Page Tweak

I made some tiny tweaks to the GB Grid Intensity page, removing some redundant stuff including Twitterisms, by editing the properties file and waiting for a recalculation/rebuild.

I validated the live HTML with the online Nu Html Checker, as usual, which pointed out some further characters to excise...

(Yes, this was "testing in production", so sue me!)