Archive for September, 2007

h1

REST 101 with Rails

September 1, 2007

railsI’m doodling around with a new idea. Since it’s goal is to produce several standardized web feeds (Atom, KML, HTML) of a data set over the web, I’ll be using Ruby. Since it makes sense for this to be a REST web service, I’ll also be using Rails. Mike asked about Rails yesterday, and I just read a GREAT introduction by the Softies on Rails guys called “REST 101“. It’s split into five parts (start reading from the bottom), with the first being a pretty non-technical overview of HTML, HTTP, REST and understanding their differences, and the last being technical code samples to show why Rails is a very clean way to pull this off. It’s very well written and I encourage even non-technical people to read at least the first section. Others can read until their eyes glaze over.

BTW – these guys put on a two day “Essential Rails” seminar in Chicago which I attended this past January. I see another is coming up Sept 21-22. Highly recommended.

Photo credit

h1

This is why I was trying to stay under the radar

September 1, 2007

Thanks Mike.

So my wife – you know, the one with the Masters Degree in Education and the Scrabble Championship Trophy – comes home and I say “Have I got a funny story for you!” She reads Wurzer’s classy post about Titze Fly and says “That’s not how you spell it”. After the bet is established, she spends 5 seconds in Google (yes, on my new Mac) totally smacking me down.

The results:

  • spelling beetitzefly.com and tzetzefly.com now go to the same place.
  • I have a renewed education in DNS.
  • We are going where my wife wants for dinner.
  • The smack talk will continue throughout the three day weekend.

At least she didn’t take my compuer away. I do, however, have to come to bed on time…

h1

I’ve been “outed”

September 1, 2007

jack in the boxSo Wurzer outed me! I figured I’d start slowly and build up some stories before I told *anybody* about this (that’d give me a chance to quit silently), but leave it to him to find me less than a week in. That’s either an indication of how dialed in Wurzer is, how social and linked the internet has become, or I guess a little bit of both. As always, Wurzer’s a class act, and a must read.

I guess I have to tell my wife why I’ve been staying up late now… (maybe you can give me some tips on that Mike?)

h1

Building librets on Mac OSX

September 1, 2007

SpaghettiI’ve used librets with Ruby on WinXP for a while now, but now I need it on my new Mac to try out some new ideas with RETS. Clearly, I’m a Mac “noob”, but boy – was this freakin’ hard! I’ve documented it here for future reference. Hopefully it will help someone else out.

Download librets

  • Download librets-1.1.9.tar.gz from CRT.
  • According to /doc/build/mac-osx.txt and unix.txt, it looks like there’s a lot of dependencies to install and build, which I’m not too comfortable doing manually.
  • There’s a note that that the OpenDarwin package manager can install these for you, and I remembered reading about MacPorts earlier, so that seems worth installing.

Install MacPorts

  • Download and install MacPorts from http://www.macports.org/
  • Make sure path is correct according to installation instructions.
  • Update MacPorts using “sudo port selfupdate”.

Install dependencies

  • Install Boost using “sudo port install boost”. Takes a while – about 15 minutes for me.
  • Install Expat using “sudo port install expat”
  • Install ANTLR using “sudo port install antlr”
  • Install libcurl using “sudo port install curl”
  • Install swig using “sudo port install swig”. This was not documented as a dependency, so it took a while to figure this one out after the below steps kept failing.

Build librets

  • “./configure” kept returning errors finding Expat and Boost files.
  • Used “./configure –with-expat-prefix=/opt/local –with-boost-prefix=/opt/local –enable-shared_dependencies” instead.
  • “make”
  • “sudo make install”

Build librets ruby

  • In the project/swig folder, use “make ruby”

Test

  • In the project/swig/ruby folder, run “ruby login.rb” and “ruby search.rb”

You’ll know now if you’ve got everything dialed in. Note that when you are writing your own Ruby code in a different folder, make sure you include the path to librets.rb at the top like this:

# Prepend load path with path to librets.rb
$:.unshift(‘/usr/local/src/librets-1.1.9/project/swig/ruby’)
require ‘librets’
include Librets

Geez! That took a while. I guess if I’d had a lot of *nix experience, it would have been easier, but librets has a special Windows install that easier.

Special thanks to the CRT guys for making librets freely available.

Follow

Get every new post delivered to your Inbox.