Have you ever been to Glastonbury? It’s massive. Seriously huge. This is a fantastic feature – there’s loads to do and you can wander aimlessly for hours and hours. However! If you’re trying to find your friends it’s a problem. Figuring out where everyone is can be tricky.
The solution, to a web technologist like myself, was obvious – build a website! As they say, when all you have is a hammer… And so GlastoFinder was born.
Interesting features of the build
This project was completed quickly. It leaned on a ton of features and patterns I have been developing over a number of years, plus some new tricks (EC2)!
EC2
This was my first personal project that made use of Amazon’s Elastic Compute Cloud (EC2). The process felt good. I created an instance and then did (roughly) this:
svn co http://svn.davegardner.me.uk/path/to/repo glastofinder_com cd glastofinder_com ./scripts/install-build-dependencies phing build
This feels good. Everything is scripted. Once I finished with the project, I simply shut down the instance. This makes use of the Phing build tool, which is mentioned in one of my previous posts.
Building on top of Twitter
This is the first time I’ve built an application on top of Twitter. What I mean by that is that the application relies on Twitter to operate and to supply some of its features (Tweet-to-check-in). My experience is broadly positive. Leveraging an existing network removes the need to build boring sign up, sign in and “follow” functionality. My only grumble is that I think the Twitter API could be less restrictive.
Using jQuery mobile for the frontend
This was picked at the last minute to get a vaguely professional frontend in a short amount of time. Whether it achieved this lofty goal is up for debate.
Solid architecture principles
The backend (PHP) makes use of a number of nice patterns that are worth a mention.
- Layered architecture – web service, domain, DAO, service
- Dependency Injection container
- Lazy-loading (virtual proxy) pattern for domain objects
- Strong OO principles including using iterator objects for collections
- Mapping pattern (blog post to follow on this)
In particular, the interplay between a strong and pure domain layer, the use of Data Access Objects (DAOs) for persistence and the mapper pattern to generate Web Service representations worked very well indeed.
Field testing
There’s nothing like a baptism of fire. I discovered at 10pm on the Tuesday before Glastonbury (I had to leave my house at 7am the next morning) that Twitter search did not include results from new users (most of my friends). There was much last-minute hackery to implement a workaround. Testing is always an important activity. Mimicking the conditions that the application should operate under is especially important to ensure things worth smoothly “in the field”.
I would say that overall the app worked “acceptably”. There were a lot of lessons learned from actually being at the festival!
Things that were a problem
- Patchy network
This probably had the biggest impact. The network was not unusable, merely patchy and often slow. This meant that the more advanced features (Google Map) were much less useful than the light-weight features (timeline / check-in via Twitter). - Setup process difficult
We didn’t invest an enormous amount of energy trying to make this smooth. The idea was that you would choose which of your Twitter friends could track your location. This avoided a blanket approach but was fiddly to setup and the UX was less than obvious. - Twitter search is heavy cruft
It’s not possible to build an app that relies on Twitter search. You are not guaranteed to get a message appearing in Twitter search and new users will be absent completely for a few days. Therefore you cannot simply sign-up to the app as a new user and start using it straight away. This would be a massive problem. There are other issues with Twitter search like the fact that the from_user_id is not actually a valid Twitter user ID.
Things that worked well
- Timeline
The timeline view was great. Firstly because you could see quickly both where people were and also who was actively using the app. Secondly because of the amount of information crammed into each entry (where someone was, when, where they were heading off to, what they were up to). Thirdly because it was fast! - Check-in and check-out via Twitter
Despite the failings of Twitter search, this still turned out to be an amazing feature. It was super fast to check-in via Twitter at one of the many hash-tagged venues – especially at busy times when 3G didn’t work (Tweet via SMS).
Potential improvements
- Crowd-sourced locations
Each Glastonbury things popup that you don’t know about before. Epic food stalls setup shop and become instant favourites (like the cheese on toast stand). Allowing users to add and share places would be a good addition. - Use DataSift!
I know these guys from Cassandra London and their product efficiently processes the Twitter “firehose”. Using this instead of the Twitter search API would save lots of effort. - Build a native app
This is something I was against when I started the project. However a native app would have a few key advantages over a website-based implementation. The major advantage would be that the map could be cached within the app itself, making it much more usable at the festival. This would not be without its drawbacks. The current implementation (based around Google Maps) lends itself to scalability – it would be relatively simple to add lots of other events, simply using Google Maps and crowd-sourced locations database.
The results
I decided to analyse my movements at the festival based on my check-ins and check-outs. As a starter for 10, I’ve just pulled out all the check-ins by day. If I get time I’ll mash this up with a map so you can see how much ground I’ve covered and/or if the geo-location was accurate!
Wednesday
- It’s 6:59 and the computer is going off now. Leaving the house in ~ 40 minutes. Any bugs are now classified as "features". 159km from the festival at 7:00am
- At Waterloo! 176km from the festival at 8:30am
- Slow progress. 171km from the festival at 10:29am
- Services! 85km from the festival at 11:45am
- Holy moly I’m getting near. Last 3G signal? 44km from the festival at 1:07pm
- Frome now. The end is in sight. And it has a huge black cloud over it. 25km from the festival at 1:41pm
- Epic queues at the gate. FFS! Very near Bus Station at 2:22pm
- Oh yeah! Arrived at #busstation #glasto #checkin /cc @glastonick @sdiddy At Bus Station at 2:25pm
- I can _see_ gate a. But I can also see a lot of people between me and gate a. Very near Bus Station at 3:02pm
- #checkin #glasto #gatea Finally! At Pedestrian Gate A at 3:30pm
- On way shopping passing brielfy #glade #checkin #glasto. At The Glade at 5:20pm
- Passing #tinyteatent on way for food. #checkin #glasto At The Tiny Tea Tent at 8:55pm
- Cider, but not at a bus. Rather Brothers cider. Very near Pie Minister at 9:10pm
- Brother’s. Oh yeah. Very near Pie Minister at 9:29pm
- This is all good. Fire time at glasto. And the Internet work. 170m from HMS Sweet Charity at 10:56pm
- This is the camp site. 170m from HMS Sweet Charity at 11:14pm
Thursday
- Where am I? Campsite. Late-o-clock with BHL Very near Le Grand Bouffe at 12:48am
- Breakfast with BHL and friends. Very much the raw prawn this morning. Very near Le Grand Bouffe at 11:08am
- Milling about. Wondering without aim! Very near Reggae Delights (TBC) at 12:23pm
- Sunbathing at #pyramid stage. #glasto #checkin At Pyramid at 1:40pm
- Still hanging out at #pyramid waiting for @sdiddy to get the hell out of his van! #checkin #glasto At Pyramid at 2:20pm
- Watching first live music at the bandstand! Yay! 170m from HMS Sweet Charity at 4:10pm
- Having tea at the #tinyteatent – will be here for a bit. #glasto #checkin At The Tiny Tea Tent at 5:00pm
- Near the #glade watching the band who opened first #glasto at spirit of 71 stage. #checkin At The Glade at 6:05pm
- Still at #parkstage but heading off soon. #glasto #checkin At The Park Stage at 10:25pm
Friday
- Wakey wakey rise and shine! At #pyramid with @terrahawkes for first band of the day. #glasto #checkin At Pyramid at 11:00am
- At #westholts watching 30 drummers tearing it up. #glasto #checkin At West Holts at 12:30pm
- Passing #tinyteatent on way to Avalon. #glasto #checkin At The Tiny Tea Tent at 1:40pm
- Found real ale. At a bar. Neat Avalon I think. Hanging here. Is good. I have zero faith in GPS location ability! 170m from HMS Sweet Charity at 2:09pm
- Listening to the mad hatters (i think) tear it up at #avalon. #glasto #checkin At Avalon at 2:45pm
- It’s official. @terrahawkes is a bad influence. At #avalon still. Good music here. #glasto #checkin At Avalon at 3:45pm
- Watching BB King at #pyramid #glasto #checkin At Pyramid at 4:55pm
Saturday
- Gentle introduction to the day at #tinyteatent. #glasto #checkin At The Tiny Tea Tent at 11:00am
- Managed to watch a band twice. #checkin #glade #glasto At The Glade at 12:35pm
- At #dance (west) for fujiya miyagi. #checkin #glasto At Dance Village at 1:05pm
- At #Avalon watching someone who is the champion of the world. #checkin #glasto At Avalon at 2:25pm
- In #avalon cafe with a coffee and the paper. Hedonistic! #glasto #checkin At Avalon at 2:40pm
- At #westholts with @sdiddy going to get a cider. The sun is out again! #glasto #checkin At West Holts at 3:15pm
- Still at #westholts. #checkin #glasto At West Holts at 4:20pm
- I appear to have not left #westholts yet. I blame @sdiddy. #checkin #glasto At West Holts at 5:15pm
- _still_ at #westholts. The sun is hot. I have a ukekele. All is good. /cc @Pikesley (start a band?) #glasto #checkin At West Holts at 5:30pm
- At #pyramid to see some band @sdiddy wants to see! #checkin #glasto At Pyramid at 6:05pm
- About to peak? #pyramid #glasto #checkin At Pyramid at 7:25pm
- Holy moly, it’s Elbow at #pyramid and I’ve just sung happy birthday! #checkin #glasto At Pyramid at 9:10pm
- Tell a lie. I mean #Avalon. #checkin #glasto At Avalon at 10:55pm
Sunday
- At #pyramid, so early the litter-pickers are still going and there’s no music. #checkin #glasto At Pyramid at 10:00am
- Watching fisherman’s friends. #checkin #glasto #pyramid At Pyramid at 11:05am
- Still at #pyramid. Staying for Paul Simon. #glasto #checkin /cc @sdiddy At Pyramid at 2:20pm
- Still at #pyramid. Paul Simon on next. #glasto #checkin At Pyramid at 3:55pm
- At #Avalon for Show of Hands. #glasto #checkin At Avalon at 6:05pm
- At #pyramid waiting for Beyoncé to start. #checkin #glasto At Pyramid at 9:55pm
Monday
- Heading out of #gatea. #checkin #glasto At Pedestrian Gate A at 7:40am
- 176km from the festival at 12:27pm
A final word
It was great fun building a mobile app. I’m a firm believer that you should try to work on new things all the time to build your knowledge. A big thank you to my colleagues for the endless discussions and in particular @oksannnna for the pin icons and @paugay for all the frontend work.
Tags: geolocation, glastofinder, glastonbury, html5, jquery, mobile, PHP



