Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Edinburgh International Book Festival mobile website

Octocat-spinner-32 app Update out-of-season homepage for 2014 dates March 13, 2014
Octocat-spinner-32 config Add admin cache config to stage environment June 16, 2012
Octocat-spinner-32 db As an administrator I can configure the festival dates June 15, 2012
Octocat-spinner-32 doc Added sample XML feed data from 2011 programme September 14, 2011
Octocat-spinner-32 features Add canonical links back to main site on all event pages July 04, 2012
Octocat-spinner-32 lib Add a rake cucumber:nojs for running tests without headless browser June 15, 2012
Octocat-spinner-32 log Initial rails 3.1 app June 08, 2011
Octocat-spinner-32 public Humans August 11, 2011
Octocat-spinner-32 script Event calendar June 28, 2011
Octocat-spinner-32 spec Add Google Site Verification code to homepage header July 04, 2012
Octocat-spinner-32 test mobile-HTML5 boilerplate first pass June 08, 2011
Octocat-spinner-32 vendor Removed modernizr August 11, 2011
Octocat-spinner-32 .autotest Split day listings into adult and children tabbed sections; Mark sold… July 06, 2011
Octocat-spinner-32 .gitignore Remove sensitive data from VCR cassettes, allowing them to be checked… August 25, 2011
Octocat-spinner-32 .rspec Event calendar June 28, 2011
Octocat-spinner-32 .rvmrc RVM config for ruby version and gemset management June 24, 2011
Octocat-spinner-32 .travis.yml Use the correct syntax to execute travis_deployer.rb January 12, 2013
Octocat-spinner-32 Gemfile Update ZenTest for Travis compatability April 16, 2013
Octocat-spinner-32 Gemfile.lock Update ZenTest for Travis compatability April 16, 2013
Octocat-spinner-32 Guardfile Fix Jasmine test config September 07, 2011
Octocat-spinner-32 LICENCE Added licence and fleshed out readme with licence and contact info August 16, 2011
Octocat-spinner-32 Procfile Added Procfile for Thin web process on Heroku June 08, 2011
Octocat-spinner-32 README.md Add README note about the Chrome WebDriver install script May 01, 2012
Octocat-spinner-32 Rakefile Initial rails 3.1 app June 08, 2011
Octocat-spinner-32 config.ru Initial rails 3.1 app June 08, 2011
Octocat-spinner-32 install_chrome_webdriver Install the latest version of Chrome WebDriver January 11, 2013
Octocat-spinner-32 travis_deployer.rb Update deploy script - always push current branch to master January 12, 2013
README.md

Edinburgh International Book Festival mobile website

** View builds | master: Build Status | stage: Build Status | production: Build Status **

What is this?

This is the application behind the Edinburgh International Book Festival 2011 mobile website at m.edbookfest.co.uk which was developed by James Newbery of Tinned Fruit Ltd. The project originated at Culture Hack Scotland and was supported by the Edinburgh Festivals Innovation Lab.

Licence

m.edbookfest.co.uk mobile website application Copyright © 2011 Edinburgh International Book Festival Ltd

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Acknowledgement

If used for the purpose of creating a public website, we ask that - in addition to the requirements of the GNU GPL - future users of this application include an acknowledgement within the credits or information section of their own site as follows:

This website makes use of technology developed by Tinned Fruit Ltd (www.tinnedfruit.com) for the Edinburgh International 
Book Festival Ltd (www.edbookfest.co.uk) with the support of the Edinburgh Festivals Innovation Lab and Culture Hack Scotland.

This credit should also be included as a meta-tag within the <head> element of all pages within the site.

This acknowledgement is non-contractual, but it is a condition of licence that the request be distributed verbatim as part of the original licence terms.

Contacts

We are keen to see other cultural organisations building on what we've done, and are happy to answer questions and provide further information if required. In the first instance, please contact admin@edbookfest.co.uk.

If you do find the code useful, we'd love to hear from you. Drop us a note at the Book Festival, via @acoulton or @festivalslab on twitter, or through the festivalslab organisation on GitHub

Data Sources

The application combines data from a number of sources:

All external APIs are open access - with the relevant keys and subject to terms and conditions - and details are available on the linked pages above.

Edinburgh International Book Festival programme listings data

This is a superset of the real-time data provided to the Edinburgh Festivals Listings API which includes meta-data on related authors and books as well as more detailed data on pricing, sponsors, titles and subtitles in festival-specific format (elements of which are concatenated to fit the cross-festival API data format).

The data is served as a single XML document, protected by standard HTTP Basic Authentication, and the Book Festival are happy to discuss providing access - subject to acceptable use policy - to other developers and consumers. The XML schema for this document is provided within the /docs folder of this repository, as is an archive copy of the 2011 XML document for development, testing and review purposes. Please note that URLs listed within the document are not guaranteed to be persistent and may become unavailable over time. Under no circumstances should this data be used other than for experimentation. To discuss access to live data, or other usage of archive data, contact Andrew Coulton.

Edinburgh International Book Festival bookshop stock data

This is a feed from the Book Festival's independent Bookshops' stock control system, again provided in XML format and containing details of every title ordered for stock in the bookshops (which includes backlist titles, and general stock not related to current events).

It is served in XML format over HTTP, and again the Book Festival is happy to discuss providing access to other users. The XML schema is provided within the /docs folder of this repository, and as above an archive copy of the 2011 XML document is also available.

Development

The Edinburgh International Book Festival mobile app is a Ruby on Rails 3.1 application. Installing and setting up for local development follows the standard path for Rails applications.

Pre-requisites

  • Git
  • Ruby 1.9.2 - suggest using RVM to manage Ruby versions and gemsets
  • RubyGems
  • Bundler (gem install bundler)
  • Chrome WebDriver for running some Cucumber features - note that this can be installed with "sudo ./install_chrome_webdriver" in the project root directory. A physical display, or an emulator such as xvfb is required - see the Travis configuration for a usage example.

Installation

The following instructions are for Mac OS X, but should also work for Linux. Windows users may have to be creative.

  • Fork / clone this repo using git clone (use GitHub's help if you are not familiar with Git)
  • cd edbookfest-mobile
  • At this point, if you have RVM installed, it will prompt you to create a project-specific gemset named 'edbookfest-mobile'.
  • From the project root, bundle install to install required gems.
  • rake db:migrate to run database migrations
  • To run the application locally, run foreman start or rails server. You should see a festival calendar when visiting the home page. There will be no data in the application at this point.

Fake data

There is a basic rake task to create some fake events data, but this does not currently include featured authors or books. Run rake listings:fake.

Programme listings data

If you would like to have access to the EIBF programme listings data feed, please see the above section on obtaining access credentials.

Listings data are consumed over HTTP via a rake task to import and update the database. The task requires the presence of these environment variables:

  • EIBF_FEED_URL - full URL to the XML events feed
  • EIBF_FEED_USERNAME - HTTP basic authentication username for feed
  • EIBF_FEED_PASSWORD - HTTP basic authentication password for feed

rake listings:import will create or update event listings, featured authors and featured books from the feed.

Stock data

Edinburgh International Book Festival bookshop stock data is also available as a feed. Stock data is imported in a separate rake task, and requires the following environment variable:

  • EIBF_STOCK_URL - full URL to the XML stock feed

rake stock:import creates or updates book entries in the local database.

Gems

Some of the key gems used in the project:

Tests

The codebase has good test coverage with Cucumber examples driven by Capybara, an RSpec suite and Jasmine examples for JavaScript code.

Other test tools are used for mocking time (Delorean), recording and replaying external HTTP responses (VCR), mocking HTTP responses (WebMock and Fakeweb) and creating fake data (Factory Girl).

Tests are run in the usual way:

  • rake will run all Cucumber examples and the RSpec suite
  • rake cucumber runs just the cucumber examples
  • rake spec runs just the RSpec suite
  • rake jasmine or rake jasmine:ci will run the Jasmine JavaScript examples
Something went wrong with that request. Please try again.