Quantcast
Channel: ruk.ca - Peter Rukavina's Weblog
Viewing all articles
Browse latest Browse all 4349

Marking up blog posts with carbon emissions data

$
0
0

On Monday my friend Ton posted a brief update on his blog:

Arrived in Brussels for Edgeryders SF authors and economists meetup. Looking forward to it.

Like a lot of blogging, this post concerned travel: in this case, a train trip (I’m hopefully assuming, given the distance involve) from Amersfoort to Brussels).

I’ve been thinking a lot about the importance of surfacing the carbon impact of our daily activities; travel, especially, is important to focus on, both for its significant contribution to total emissions (48% here in PEI) and because travel is something that we have atypical agency in reducing (it’s easy to decide not to fly to Europe; deciding not to heat my home is harder).

Anecdotal evidence from my personal experience suggests that paying continuous partial attention to consumption can have a positive effect on reducing consumption: even absent any other drivers, the mere fact of observing, it seems, is helpful.

Which leads me to an idea.

HTML has a helpful extensibility that allows data to be embedded in web pages using “data attributes.”

What if Ton’s post embedded the carbon impact of his travel, and perhaps his mode of travel, turning this:

<p>Arrived in Brussels for Edgeryders SF authors and economists meetup. Looking forward to it. </p>

into this:

<p><span class="emissions" data-co2="7.5" data-travelby="train">Arrived in Brussels</span> for Edgeryders SF authors and economists meetup. Looking forward to it.</p>

(the CO2 emission of a train trip from Amersfoort to Brussels are estimated to be 7.5 km by EcoPassenger).

To the casual reader of the blog post, nothing would change.

But with a little JavaScript, a curious reader could pull out the carbon impact of the activities described in the post:

var emissions = document.querySelector('.emissions');
console.log(emissions.dataset.co2);

Adopting this as a standard practice would be beneficial for two reasons:

  1. For the blog author, forming a habit of documenting the climate impact of travel could be helpful in understanding more about (and coming face-to-face with) the accumulating effect of travel habits.
  2. For the researcher, being able to extract climate impact data from blog posts could prove a useful data surface, and could spur the development of browser-based tools that could use this information in interesting ways (i.e. change the colour of the browser toolbar based on the carbon impact of a post).

To experiment with this, I’ve started by marking up a blog post of my own, adding two chunks of “carbon markup”:

<p><span class="emissions" data-co2="1460" data-travelby="airplane">We flew Charlottetown-Montreal-Vancouver today</span>; we didn't leave Charlottetown until 4:00 p.m. and we're in bed in Vancouver at 11:00 p.m. Such is the wonder of the rotating Earth.</p>

and:

<p>We found our way to the SkyTrain, <span class="emissions" data-co2="0.067" data-travelby="transit">navigated to the Yaletown station</span>, walked up the hill to Burrard. And are now ensconced inside The Burrard.</p>

I can then extract the carbon impact of that post’s travels with this JavaScript:

var emissions = document.querySelectorAll('.emissions');
var total_co2 = 0;

emissions.forEach(function(trip) {
  total_co2 += parseFloat(trip.dataset.co2);
});

alert("Total CO2 from this post was " + total_co2 + " kg.");

which displays:

Alert showing total carbon emissions of 1460.067 kg,

I’ve no idea whether this methodology is the best methodology, but I like the fact that it’s simple and doesn’t take much expertise to inject into a post; it would certainly be possible to add structured metadata to a post using JSON or XML, but that would add a perhaps-unnecessary level of complexity. And for this to work, it has to be easy.

Thoughts?


Viewing all articles
Browse latest Browse all 4349

Trending Articles