The other week The Register wrote an article, which talked about the Indieweb, and Webmentions in particular.

The article covered a bunch of things, but highlighted the potential spam issue with webmention, which I’ve been meaning to do something about in Known for a while. Since Known was mentioned right at the end of the article, I figured I should probably pull my finger out.

So, while the community build a better way of handling spammy comments and webmentions (e.g. Vouch, or similar graph based filter), I put together a very quick Akismet plugin. Obviously this is centralisation / single point of failure, but it’s a quick fix that’ll hopefully stop the worst of the problems while we build something better.

Usage

Install in the normal way, and activate with your wordpress API key.

Now, all new annotations (including comments and webmentions) will be passed through akismet before being posted. Note, the entire thing requires you to be running a version of Known with the annotation/save event hook added by this pull request.

Enjoy.

» Visit the project on Github...

I had a little bit of time over the weekend (actually, that’s a complete lie, I had no time, I was just procrastinating), so I dusted off and fixed up some old code I was working on but never finished.

So, here you are, a quick plugin which adds lightbox modal display for Photos. Currently it just shows the image, but if you’ve applied this patch (which hopefully will be merged soon), you’ll also see titles and description.

The library makes use of Ashley White’s Bootstrap 3 javascript lightbox library, which is distributed under the MIT licence.

» Visit the project on Github...

For me, getting to many of the activities I enjoy, involves crossing a river.

Normally, this is about 35-40 minutes on bike, but if the crossing is flooded, I have to take a ~20 minute detour. What’s more, it’s dark, and this often involves me suddenly getting very wet feet.

Thankfully, it’s the 21st century, and I can do something about this!

Flood sensors

The UK Environment Agency, thanks in a large part to the wonderful work being done by the Data.gov.uk, has made the data for their network of flood sensors available on the internet.

I can tell, by visiting a webpage, more or less whether I need to take the short or long way round.

This wasn’t enough for me, because I’m lazy, and I want to be able to either ask the question “Is sandford flooded?” in a console window, or have my computer send me an alert if I need to allow extra time to get in. Unfortunately, there’s no feed of this data immediately available, but this was nothing a bit of Script-Fu wasn’t able to sort out!

The first step was getting the current levels. Looking at the markup, you can see that the current level is a nice two digit number between two <strong> tags, so this was pretty easy to regex for.

The second was to get a value for what the environment agency considers “flooding” for this sensor. This was a little bit more tricky, but it’s marked on the graph, and it would seem that the source for this is a JSON blob in the html, so again, relatively straightforward.

Putting this together, I was able to build a nice little script that, when given a sensor’s webpage, compares these two values and gives you a simple yes or no as to whether it’s flooded. For bonus points, and because the surrounding low areas may flood before the sensor does, I took a 90% value for a given sensor and use it to return an “Almost” if reached… kindof a “proceed with caution”.

This was pretty much to scratch my own itch, but since the flood sensor network is nation-wide, I figured it might be useful to someone else out there!

» Visit the project on Github...