-
OpenTech on 5th July is an informal one-day conference about technology, society and low-carbon living, featuring Open Source ways of working and technologies that anyone can have a go at.
mySociety related sessions:
- mySociety session – more on time travel maps, and the launch of WhatDoTheyKnow.com, and a few other surprise announcements
- No2ID and Open Rights Group: State of the Nation
- Here’s the UK EFF
- Power to the People – One year one from the Power of Information Report
- …and much more
-
TheyWorkForYou video timestamping has been launched, over 40% of available speeches have already been timestamped, and (hopefully) all major bugs have been fixed, so I can now take a short breather and write this short series of more technical posts, looking at how the front end bits I wrote work and hang together.
Let’s start with the most obvious feature of video timestamping – the video player itself. 🙂 mySociety is an open-source shop, so it was great to discover that (nearly all of) Adobe Flex is available under the Mozilla Public Licence. This meant I could simply download the compiler and libraries, write some code and compile it into a working SWF Flash file without any worries (and you can do the same!).
Writing a Flex program is split into three main areas – MXML that lays out your application, defines any web services you’re using and so on; CSS to define the style of the various components; and ActionScript to deal with things like events, or talking to the JavaScript in the parent HTML. My code is probably quite shoddy in a number of places – it’s my first application in Flex 🙂 – but it’s all available to view if you want to take a peek, and it’s obviously running on the live TheyWorkForYou site.
To put a video component in the player is no harder than including an <mx:VideoDisplay> element – set the source of that, and you have yourself a video player, no worrying about stream type, bandwidth detection, or anything else. 🙂 You can then use a very useful feature called data binding to make lots of things trivial – for example, I simply set the value of a horizontal slider to be the current playing time of the video, and the slider is then automatically in the right place at all times. On the downside, VideoDisplay does appear to have a number of minor bugs (the most obvious one being where seeking can cause the video to become unresponsive and you have to refresh the page; it’s more than possible it’s a bug in my code, of course, but there are a couple of related bugs in Adobe’s bug tracker).
As well as the buttons, sliders and the video itself, the current MXML contains two fades (one to fade in the hover controls, one to fade them out), one time formatter (to format the display of the running time and duration), and three web services (to submit a timestamp result, delete a mistaken timestamp, and fetch an array of all existing timestamps for the current debate). These are all called from various places within the ActionScript when certain events happen (e.g. the Now button or the Oops button is clicked).
Compiling is a simple matter of running mxmlc on the mxml file, and out pops a SWF file. It’s all straightforward, although a bit awkward at first working again with a strongly-typed, compiled language after a long time with less strict ones 🙂 The documentation is good, but it can be hard to find – googling for [flex3 VideoDisplay] and the like has been quite common over the past few weeks.
Tomorrow I will talk about moving around within the videos and some bugs thrown up there, and then how the front end communicates with the video in order to highlight the currently playing speech – for example, have a look at last week’s Prime Minister’s Questions.
- The Flash player
- Seeking
- Highlighting the current speech
-
This project became Mapumental. Please visit that site for details of our travel-time maps services.
The work was funded and supported by the Department for Transport.See also: the main travel-time maps report.
——————
Our newly released travel time maps are currently shooting round the internet. It was great fun making them, and you might like to have a go too – there are plenty of public datasets you could overlay on the same base maps, using the same flash app (source code). There are a few notes about how we made them on the page itself, and the associated real time page. For a far more interesting view of the development process, read Tom Carden from Stamen’s account.
The most interesting blog post I’ve seen to come from this is Whitehall staff have no life by Simon Dickson, who was inspired by the maps to think about the destruction of social capital caused by commuting. “Whitehall staff on all but the highest salaries can’t expect to live anywhere near their work, and hence can’t expect to have any kind of a social (capital) life.”
-
I’m very pleased to announce that the petitions system we’ve built for 10 Downing Street has gone live today.
I’m very grateful for the hard and often inspired work put into this by Chris Lightfoot and Matthew Somerville, as well as the civil servants who have helped to build a petitions system which I believe is in a real class of its own.
The most notable features are:
1. Petitions are accepted and published, regardless of the political slant of the petition. However, if they break the Ts&Cs (a petition that doesn’t actually ask for any action, for example) then they are put on a special rejected petitions page: they don’t just vanish. We think this transparency feature is probably unique.
2. The site is being launched in beta, and will change over time. This might seem too commonplace to note for many of you, but it reflects a willingness to see a public IT service evolve in response to users, not simply fulfil a contract agreed in advance. mySociety exists partly to spread good practice in the public sector, and we think this is a nice example of that in action.
3. The code, including Chris’s amazing high-load optimised engine, is all open source.
Any questions? Come into our chat channel at www.irc.mysociety.org or mail us at hello@mysociety.org.
-
mySociety has been asked to do some work on an online petition system for Number 10 Downing street. mySociety is delighted to have been asked to bring our experience to the task, and aims to develop a new tool as easy to use, popular and trustworthy as our other non-partisan democractic web sites. In particular we are pleased to have jointly designed a system in which moderation is extremely transparent, and which we hope can be used as an exemplar of good practice elsewhere.
Francis and Matthew have just started coding, and we plan to have a public beta running later in the year. All the code that is generated by mySociety (and which isn’t specific to the No10 site, like logos) will of course be available under open source licences, and we will be delighted to talk to other organisations who are interested in petition systems themselves.
-
Continuing its borg-like absorption of all civic software, the mySociety repository now contains the source code to TheyWorkForYou. You can browse it here. It is licensed slightly more liberally than the rest of the mSociety code, under a BSD style license rather than Affero GPL.
Up until now the poor code has only seen freedom as a cunningly hidden tarball on Sourceforge, released every time somebody asked me to. It’s rubbing its eyes, a mole coming out of the dark, so be nice to it. Or perhaps sign up to Github to get email every time anything is done to it.
Some random things to look at or do:
- A directory called easyparliament, a jokey name we considered calling the site for a while. Well, it wouldn’t have got us into as much trouble as calling it (guy) fawkes!
- Digest the Wikipedia linking code (this nasty shell script finds the latest titles database and downloads it from wikipedia), find the code that calls it, and tidy it up so it links to TWFY for MP names said by MPs, rather than to Wikipedia.
- Read a list of things that need doing to it, or make up your own.
-
We’re all busy giving WriteToThem some tender loving care. Everything from installing the latest versions of BoundaryLine and CodePoint to generating yearly statistics we’d like to be as fun and pretty as this. Watch out for more announcements as the week goes past.
The new servers are mostly running happily now. Amongst other things we can much more easily make developer sandboxes. So if you want a quiet place to hack some improvements to any of our sites, let us know.
-
(Shh, don’t tell anyone, but this post is really just so the bots find debian.mysociety.org, but I’m going to try and fill it with some other content so you don’t think I’m being too rude)
Debian’s software “packaging” system provides a big database of all the open source software in the world, and makes another smaller database of all the software installed on your computer. We’re using it on our new servers, which the sites are gradually migrating to now. When you’ve got security updates, multiple machines, and complex software dependencies, you need it.
Unfortunately, though it seems like the Debian people have packaged nearly all the software in the world, sometimes they miss things. Normally we’d just install them using the old Unix configure/make/make install. This time we’ve decided to do it properly, and make our own Debian packages. You can find them at debian.mysociety.org.
The advantage of this is that we can find out where any file on the system came from. We can easily upgrade multiple machines, and check that they all have the same software installed. This makes it much less likely that there’ll be bugs when you go to a corner of one of the websites, and get an error because a perl module wasn’t installed.
So far there are a few perl module .deb files in our repository, which the handy dh-make-perl builds easily from a perl module tarball. There’s also Xapian (a search engine library), which we use for quick lookups in Gaze (our gazeteer). That had already been packaged by the Xapian people, but for some reason I had to recompile it. Finally there’s one Python module, PyRTF, which makes Python modules, which I just packaged (probably badly).
Anyway, this post is here to make sure anybody searching for python2.3-pyrtf on Google will find something…
-
mySociety yesterday launched a pair of Back o’ The Envelope projects based on Google Maps.
Placeopedia.com — Connect Wikipedia articles with the places they represent
YourHistoryHere.com — Share local and geographic history and trivia.
There are a few things to say about both projects:
1 – As is normal with mySociety projects the code for these projects (excepting Google maps) is open source. We hope that by providing a ready-made annotation system, people will find it easier to make their own publicly-authored layers of information.
2 – Both sites syndicate their data under open source licenses, and in a location-queryable fashion. This is really important, as it allows for all types of nice local history to be syndicated to tourism sites, local community discussion boards, blogs and so on.
3 – We’re calling them ‘Back o’ the Envelope’ to contrast them to the big, polished and time consuming projects we run like PledgeBank.com and WriteToThem.com.