Archive for the ‘ruby’ Category

h1

Inman ConnectTech 2009 wrap-up

August 12, 2009

The first day of the Inman Connect conference this year included the ConnectTech Workshop, which I moderated.  The idea was to bring back some more technical topics to appeal to the developers and geeks in the industry.  See the full agenda here.

Here’s a synopsis of my take aways from each session:

  • Mobile – The statement was made repeatedly by Eric from SmarterAgent and Jim from Kurio that users demand native apps customized for each phone.  That may be true right now, but I see the adoption of HTML5 in mobile browsers, combined with abstraction toolkits like PhoneGap, making possible universal, browser-based apps in the future.  At least I hope so – building native apps for each platform right now is a very expensive and time consuming endeavor.  Sasha from Redfin concentrated on the importance of a clean and simple UI for the phone, but would not give up any details on the rumored imminent release development of a Redfin mobile app.
  • API’s – Oren from Mashery made the point that you should think of your API as an “ecosystem” wrapped around your data or service.  That was very well received, and set the stage for Matt from Walkscore and Steve from Education.com to discuss exactly what they’ve done, on a more practical level, with their API’s.  We use both of those API’s in Dwellicious and that data is very popular.
  • MLS Hell – What would an Inman conference be without people complaining about MLS data standards?  The panel – Chris from Wolfnet, David from eNeighborhoods, and Mark from Homefinder – each gave an overview of their architecture for downloading and normalizing MLS data.  The general agreement was that RETS succeeds in giving real-time access to updated data that can be easily downloaded, but fails when it comes to data standardization, thus the need for sophisticated normalization procedures that are unique to each MLS.  Mike Wurzer from FBS asked the group if they would adopt a new standard for field names if RETS were to create one, and the unanimous consensus was yes – although there didn’t seem to be too much confidence that this would see the light of day anytime soon.  One thing the struck me was the huge cost that hundreds of vendors are incurring doing the same exact thing – downloading and normalizing MLS data.  Of course, that cost is being passed on to the customers.
  • User Experience – This panel was designed to be a discussion about Flex, Silverlight, and AJAX.  Cosmo from ForeclosureRadar.com was up first and gave an overview of their architecture which used a web services back-end and a Flex front-end.  He was very careful to point out the positives and the negatives of Flex – the main positive being the speed of UI creation and the main negative being lack of a good PDF/printing solution.  For PDF creation, he had to fall back on a PHP solution, but I felt that was a good example of using the best tool for the job and not forcing everything to be Flex.  Ben from Ajaxian.com and Mozilla then gave what I thought was the most fascinating presentation of the day when he showed browser developments coming in the next year.  He showed what could be done with HTML5, Canvas, and made the point that the speed of the new generation of browsers made certain client side and AJAX techniques possible that weren’t just a year or two ago.  His presentation further convinced me that open standard browsers are, currently and in the future, the direction to take for client side UI.  Interestingly, we were not able to find anyone to speak on Silverlight, and even those few in the audience who indicated they were doing some development with Silverlight had no positive comments to make about it during the Q&A segment.
  • Agile Development – This was a panel I was really looking forward to, being that it’s a hot topic right now, especially in the Ruby on Rails community.  Mike from Elevated Rails gave a great overview of Agile, then Zach from Point2 brought some practical experience and stories about how he used Agile to make their large team of developers more efficient.  Galen from Estately then followed with details of how they use Agile and Rails with their small team of developers.  My take away on this one is that Agile not only makes development teams more efficient, but also makes them happier because they are getting constant feedback on their projects and that is keeping them from going down blind alleys, diverging from the goals of the customers and the rest of the organization.

My one complaint was that 45 minutes for each panel of three speakers made everything too rushed – I would like to see one hour sessions next year.

What did you take away from ConnectTech?  I covered the entire Inman Connect conference in another post.

h1

Mechanize to the rescue

February 10, 2009

If you’re using Ruby to download pages via http, you have a couple of standard choices.  Open-uri is the easiest method, as it abstracts the download and treats it just like a file.  If you need to do something like examine headers or do a POST instead of a GET, you can step down into net/http and be a little closer to the details.

If you need the complexity of sharing cookies across a session and handling re-directs from an MS IIS web server, then don’t spend two days trying to get these two to work like I just did.  Jump straight to Mechanize – just install the gem.  It handled the complex re-directs, the cookie sharing, and both GETs and POSTs with a magical ease.

I haven’t gone any further with it, but apparently Mechanize can do a lot of other stuff too, like find fields and fill out forms.  In combination with Hpricot, it would be a natural for some pretty complex web spidering.

Hope this helps save someone else two days.

h1

Github is cool

September 19, 2008

One of the things I’m enjoying most about Ruby is the energy and sharing that goes on within the community.  Github is turning into the hub that feeds that community.  They bill it as “social code hosting”.  Huh?  Code has never really been a social thing, and the root of github is git – a source code control app – just about the most boring class of software apps there is.  But github offers some innovative new features:

  • every member gets their own space where they can upload their code projects to share with the community, along with the standard profile and RSS feed features you’d expect.
  • search for code you need to complete your own projects and sign up to “watch”, or be notified when any project that you’re using changes.
  • a seamless way to push version controlled code from your desktop to the hub, into either public or private repositories – public repositories are free, whereas privates ones have a reasonable price.
  • and an easy way to fork others code so that you can modify it for your needs or to fix bugs, then push back up to the hub for the benefit of the rest of the community.

Since it went live this year, many very high profile projects have moved to github, including Rails, Merb, Capistrano, Scriptaculous, and Prototype.  In my new project, I am using Will_Paginate, Hpricot, Restful_Authentication, JSON_Printer, and Acts_as_taggable_on_steroids – all downloaded from github.

I was able to add a feature I needed to JSON_Printer, a small project produced by the programmers at TechCrunch, and posted it back to the community.  Just today, I uploaded a new project called NumberTwoPencil which I created to interface with the Education.com API announced earlier this week.  If you have a need for school data in your Ruby app, check it out, make improvements, and share it back with me.  I’m also hosting two private repositories there, code I push every night for backup purposes.

The most popular projects can be seen at http://github.com/popular/watched.  My projects can be viewed at http://github.com/danwoolley.

h1

Automatic blog posts from your Google Reader Shared items

September 9, 2007

You may notice every once in a while I have a post titled “items from” and some date, with the content being some (hopefully) interesting items I’ve read on the web that day. Creating that post looks like a simple matter of manually creating a new post, copying and pasting the title and a summary, then adding some formatting and publishing. While that isn’t too hard, even easier would be if you could just share interesting items in your Google Reader (using the “Share” link) during the day and have them magically appear later that night in your blog.

Below is a Ruby script I wrote that does just that. It consumes an Atom feed of your Google Reader Shared Items, formats them, and automatically posts them to your WordPress blog using their XML-RPC interface. You can run this manually, or schedule it to run at a specific time as a cron job. Note that this does not rely on inserting the post directly into the WordPress SQL tables as I’ve seen other WP plug-ins do – that requires you to have access to the WP database, which you don’t if (like me) your blog is hosted at wordpress.com.

This whole process takes less than 100 lines of Ruby, including lot’s of comments. What this shows is how easy it is to “glue” together different web services to accomplish a useful goal when all the players use well documented web standards. It also shows how simple, yet powerful, a dynamic scripting language designed for the web can be.

The script can be found here. Read the comments at the very top for examples of how to run it. Make sure you edit your personal settings in the “Stuff you should change” section.

Later, I’ll show you a similar script that automatically creates blog posts from your del.icio.us links.

h1

On the relationship between open source software and real estate business models

September 3, 2007

pot of gold?I had originally titled this “Installing Ruby on Rails on Mac OSX”, but as I typed, it gradually became about this other, more general, topic.

I saw this a little too late, but next time, I’m going to try RM-Install from Five Runs. Looks like it installs a very comprehensive Ruby on Rails stack from one place in minutes.

This is also an interesting look at an open source business model. Notice that they are offering you the free Ruby on Rails stack that you need, in a value added package, in exchange for lead information. You must enter an accurate e-mail address because they are delivering the actual download link to your inbox. To be clear, everything they are giving you is open source and freely available from different sites, but they are combining it into a single package so that the customer can save time and increase compatibility.

Five Runs also currently offers a Rails management solution called RM-Manage (very cool, watch the demo video) for which they charge a monthly subscription fee. From the looks of it, these two offerings are just two pieces in a much larger suite of services they are building out to ride the wave of Ruby on Rails as it washes into the enterprise space.

This model relates to real estate in so many ways:

  • What can you package up and offer potential customers, at low cost to you and free to them, that are still valuable enough for them to give you valid contact information?
  • What are you doing to ensure you contact that lead ASAP to find out further needs, establish a real relationship, and move them on to your other offerings that will generate real revenue?
  • Traditionally for real estate agents, that real income is in the form of commissions, but what can you learn from an open source based software company about generating revenue from suites of related products? Maybe on a subscription or per use basis?
  • Note how simple and professional, both the site in general and the lead form in particular, are. They make it very clear, in a subtle yet direct way, that “mickey@mouse.com” will not cut it here. If you want the value, we want the real you.

How long do you think it took me to get an e-mail from Five Runs? Yep, about thirty seconds. Of course it was automated, but if I now proceed with the download and the install goes smooth, I receive true value and I now have a positive relationship established with this company.

How long do you think it will take before someone actually calls me on the phone? I’d bet this week I’ll hear from someone.

Photo credit

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

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.

h1

Why a new Mac?

August 28, 2007

My home PC was about five years old and dragging running WinXP. I tried a little experiment with Ubuntu and I liked it a lot – more than XP for what I was doing at home. I but could never get sleep mode and color photos on the Canon Pixma i4000 working right, and those proved to be deal killers. After a few months, I gave up.

So I needed a new computer – web, e-mail, spreadsheet, photos, minor video – basic stuff.

Reasons I decided to try a Mac:

  1. With Firefox, OpenOffice, and Parallels, you no longer need Windows to run your most used apps. I decided the only app I really needed to run that required Windows was MS Money, and Parallels has that task covered.
  2. My new favorite programming language is Ruby, and that crowd is full of switchers. No need for Windows to write web apps.
  3. Lot’s of people I respect have been leaving Windows for a Mac and cite the “OS’s are becoming irrelevant, so why not use a beautiful OS” meme. See Marc Andreessen (he of Netscape, Opsware, Ning, and the cover of Time Magazine fame) and Marc Cuban (he of the Dallas Mavericks, broadcast.com, and collaring his Yahoo! stock fame).
  4. I’ve got Greg to rely on for tech support.
  5. I’d liked NOT using XP so much with Ubuntu, but needed a little more driver support and ease of use.

iMacI waited for the new 24-inch iMac’s to come out and snagged one the first week. The display is unreal, the desktop is beautiful, and everything just works. I can run WinXP in a window faster than on my old computer, and I can even drop down into Terminal for a bash shell. There’s a reason I’m seeing more and more Mac notebooks at every conference I go to.