Skip to content

spier/springerquotes

Repository files navigation

Springer Quotes

This is the source code for Springer Quotes, the application with which I won the 1st prize in the Springer API Challenge 1.0.

I am open sourcing this code, so that others can take some bits and pieces that they need. Also this seems like the right thing to do, as I have used some many open source tools (as you will see later). This code is released under MIT License (MIT).

If you should have any issues getting this to work, you can ping me @sebastianspier and I will try to help out.

Highlights

There are two interesting pieces to this application that I want to highlight:

  • ./emphasis folder - The Emphasis JavaScript Library is used for the quote selection effect in the UI. I have ported the Javascript code to ruby as well. This is used for the generation of the quotes view (see the images below).
  • ./xls folder - XSLT is used to transform Springer's A++ XML format, as returned by the Springer API, into HTML.
  • yql_simple gem - I am using my ruby gem YqlSimple as a minimalist wrapper around YQL. I don't really need the power of YQL in this application but I like YQL, so I ended up using it for the bit.ly communication ;)

Tools

Besides this source code, these are the tools and services that I used to build Springer Quotes:

  • heroku for hosting this site
  • CouchDB for the data storage
  • Ruby and Sinatra for the implementation and server DSL
  • bit.ly for shortening the links
  • Nokogiri + XSLT for the conversion of Springer's A++ format into somewhat more readable HTML.
  • MathJax for beautifying mathematic formulas
  • 'Sticky' buttons at the top of the article
  • Pure CSS speech bubbles for the nice speech bubbles you see on the /quotes page
  • jQuery as my JavaScript library of choice

Prerequisites

Before you can run this application you will need a couple of things:

  • ruby 1.8.7
  • your own CouchDB
  • Springer API keys - go to the Springer API portal and register to get your own keys
  • (optionally) a bit.ly account

Once you have these, you need to modify the configuration file environment_variables.rb accordingly.

Installation

  1. bundle
  2. bundle exec rackup
  3. Springer Quotes is now running at http://localhost:9292

Test the application by visiting the following URLs. The screens should look like the images below.

  • normal article view - http://localhost:9292/article/doi:10.1007/s10680-009-9177-y#h[Itacin,1,4]
  • quotes view - http://localhost:9292/quotes/doi:10.1007/s10680-009-9177-y?quotes=h[Itacin,1,4]

normal article view quotes view

Have fun with Springer Quotes!

License

MIT License (MIT)