January Contest: Ride4Ruby

At the DreamForce conference last month, SalesForce’s CEO, Mark Benioff, called Ruby the “Language of the Cloud.” On the show floor, I had dozens of conversations with Java developers about Ruby, and Ruby on Rails. Many of them ended up taking our Zero to Rails 3 class later that month.

In the spirit of increasing the momentum of Ruby on Rails, we have scheduled another Zero to Rails 3 class on January 24th. We are also running another contest. The prize is an Engine Yard t-shirt. For a peek at the Engine Yard crew modeling our new shirts, check out photos from Deploy Day posted to our Facebook page.

Contest Scenario

Every year, a handful of brave cyclists embark on cross-country bike rides to raise funds for various philanthropies.

Imagine you are going on an Engine Yard sponsored Ride4Ruby. The planned route hops from city to city, in search of every Ruby Street in the United States, according to Google Maps.

To win a shirt, you must do the following:

  1. Using Ruby, iterate over the list of states found here (cut and paste into an array)
  2. For each state, send a request to http://maps.google.com
  3. The requests should be as follows:http://maps.google.com/maps/geo?q={state}%20Ruby%20Street&output=xml&key={your google key}
  4. Parse your results
  5. Find the city, state, and zip code of the farthest eastern, and farthest western locations
  6. Find the distance between these cities.
  7. Make a request to:http://maps.google.com/maps/api/directions/xml?origin={eastern location}&destination={western location}&sensor=false@key={your google key}
  8. Remove your google keys from your code to protect them
  9. Share the code in a gist (https://gist.github.com/).
  10. Follow @engineyard on Twitter
  11. Tweet the following:

Learn #Ruby on #Rails with @engineyard http://bit.ly/02ror #Ride4Ruby [distance] [your gist]

Extra credit. Obviously, the distance your bike will be traveling is farther than the distance between the start and end points. Share Ruby code for calculating the shortest distance between all points, for an extra special prize, which will be announced next week after we look through the submissions.

Ready. Set. Go!

Note: Submissions are closed at midnight tomorrow (January 11th) PDT. Plagiarizing someone else’s code results in a flat tire. We will contact winners via Twitter the week of January 17.