Writing My Own Travel Agent in C#

Jul
30
2008

Yesterday, Garrick was describing the difference between a "search result" and "find". His short answer was:

Search Results Listings say, 'The answer might be here'. Find says, 'Here you are, get on with your day.'”

That distinction is something that has always struck me as irritating about using every travel site I've ever seen (later discussion revealed that, ironically, this distinction is talked about obsessively at Orbitz). That irritation is because every search I've made started out as something that doesn't fit in their search boxes: "Find me a cheap coach flight and a hotel near the conference center in Austin, TX for SXSW", "I'd like to go to San Francisco for a long weekend some time this fall; is there a way to do that for under $500?" or "Which one of these cities and which weekend will be cheapest in October for a 5 day weekend?".

Those aren't questions which naturally get answered by a search results page. You don't get to pose those questions to travel sites. What you are asked on every one of them is to choose specific dates and, in many cases, both airports. The sites don't even so much as hold on to the fact that 99% of my travel is based out of Minneapolis/St. Paul International Airport.

Rather, I get a constant flow of emails from the travel engines telling me about great deals to Miami/Las Vegas/New York for $89. Of course, if you are flying out of Minneapolis, that deal suddenly becomes $327 instead.

There is a place you could and can ask those questions and get your "find" satisfied. Travel agents pick up the phone, listen to just such a question and call you back later in the day with the results of your find. Unfortunately, they also are professionals who need to make a living. That means they're not entirely thrilled to, for instance, check daily for weeks at a time for a very specific set of criteria for a vacation I may take if the deal is good enough.

That does, however, smell of the kind of thing that I like sling a bit of code to solve. And, it's something I've wanted to solve for a very long time. Every couple of months, I go looking for a way to write code that searches for flights and hotels and have always come up empty.

Then, this weekend, I did it again and ran across the Kayak API, which looks like what I've been looking for all along. The API allows 1000 searches per day, per developer key. While that wouldn't let me create much of a public service or commercial application, it's a really roomy number if you're looking to do lots of permutations for your own travel needs.

Personally, I'd like to do things like have a list of cities I've never been to and have software grind away on it, finding a good deal for a "fall long weekend" or a "week-long summer vacation", etc. for one of those locations. Similarly, I'd like to be able to say, "I've got $300. Is there somewhere I can go and get a hotel for a 3 day weekend that's on my list?".

Software can easily handle digging through the tedious crap like seeing whether leaving on Thursday and coming back on Sunday is cheaper or more expensive than leaving on Friday and coming back on Monday. As a person, trying those combinations on the existing search results-oriented sites is tedious. Tedious is what software does best.

Before I start dreaming too big for what might be possible, I threw together a quick POC app to see how easy it might be to search and grab results. I created a really basic class library for doing the actual searches and a tiny console app to try out a single search.

I have to say, I like what I see and think that there are some real possibilities for coding up my own travel agent with Kayak.

The sample, half-finished POC code is available in PDF form if you want to look at it. It's got gaping holes all over (hard-coded, read-only properties, unused properties, concatenated strings, etc), but shows the basic idea for how to hit the service. This doesn't do anything to take advantage of any of the polling cycle that the API documentation describes, so the results are incomplete.

However, it proved what I wanted from the POC. I'm now pretty sure that I'll be able to get what I want out of that API. If you're interested in travel and writing software, it might be worth a look for you as well.

Gearing Up for Ireland Trip

Jun
19
2008

We're inside the 2 week runup to our trip to Ireland. This is a trip that we originally wanted to take 10 years ago when we got married. At that time, we didn't have the money, so we told ourselves we'd go 5 years later. Of course, by that time, we were busy and, while we could have charged the trip and paid it off, we couldn't afford to pay for it outright, so we postponed it 5 more years.

A little over a year ago, we set up a savings plan and started siphoning money off for this trip. After a significant amount had piled up a few months ago, we started booking portions of the trip and paying for them from that account. The flights ($2500 total), hotels (another $1400), car rental (more than a rental car should cost), etc. were all checked off the list with absolutely no debt incurred.

We're going to be doing the kind of travel that we've come to realize really matches how we like to do things. We book hotels smack in the middle of relatively large cities and then see and do things nearby, working out for day trips as it makes sense.

For this trip, we're actually going to spend time headquartered in 3 different cities: Cork, Limerick and Dublin.

Read the rest of this entry »

I Fell For It

May
04
2007

Earlier this week, Shelly and I were discussing our upcoming trip to Ireland. I mentioned that I'd done a bit of digging on airfare and had found some pretty good deals that got our tickets into the $750 range.

"Those are coach tickets, right?", she asked.

"Yeah. Why wouldn't they be?", I responded.

"Because we're flying to Ireland in first class. I thought we talked about this.", she continued.

I'm not sure exactly what she said immediately after that because there was this loud buzzing sound in my head that kind of muffled what she said. I think the buzzing came from the giant flying dollar signs that were whizzing around my head at the time.

As the buzzing subsided, I rejoined the conversation.

"…because I'm OK with flying coach here in the US, but for a long flight across the Atlantic, I want something like British Airways first class. You know, with the beds…"

The whizzing dollar signs were back. I didn't notice the teeth before.

I objected strenuously, indicating my complete unwillingness to go along with this particular preference. I then moved on, in completely predictable fashion, to cite the actual cost of such flights (anywhere from $3,000 to $11,000 per seat) in comparison to other things in our lives (like the fact that we only paid $6500 for my truck 4 years ago).

The argument continued until we went to bed and I dreamed about the whizzing dollar signs devouring our life savings. I spent much of my "break" times during the following day building a case against this extravagance: comparison flight prices, other things we could buy instead of that flight, things we could do *on* the vacation with the same money, etc.

In short, I was preparing to go to war over first class airfare. I went home with all of my ammunition, prepared to dig a trench and start firing.

We sat down to dinner and I launched into my prepared tirade. I got maybe 2 sentences into my speech when Shelly interrupted me.

"You know I was just messing with you, right?"

The whizzing dollar signs fell to the floor. She knew me well enough to pick something that would really get to me and used it to reel me in. I completely fell for it.

First class airfare is one of those things where even if I had $300 million in the bank, I still wouldn't pay for. The idea of paying $2500 to sit in a bigger chair for 10 hours just doesn't make sense to me on any level except complete extravagance. She knew that.

We joke around and tease a lot here. Usually, Shelly's teasing is on a small scale, but this time she brought out the big guns and won in a huge way.

Heading to Ireland in 2008 and Saving for Vacations

Apr
26
2007

In the spring of 1998, Shelly and I got married and took a semi-local honeymoon to Duluth, MN. At the time, something more extravagant was completely out of the question. We were young and just starting out.

Of course, that didn't stop us from talking about where we would have gone if we had the money. One place we both agreed on pretty early in that conversation was Ireland. She's got Irish blood and I've just always been interested in the place. That overlap quickly settled into complete agreement and we decided we'd go for our 5 year anniversary.

Well, 2003 came and went and we've still not left the boundaries of these United States together. That's all going to change in 2008. For our *10* year anniversary, we're actually going to make the trip to Ireland. A 5% savings account has been set up specifically for vacations (the first being the Ireland trip) over at Etrade. Automatic transfers have been set up to pull money into the account on a weekly basis. There's almost $600 in the account as we speak.

By the time school lets out (and our exchange student goes home) next spring, we'll have the cash on hand to pay for the trip in its entirety and really enjoy it. That savings account is actually key to this whole thing happening. We've brought up bigger trips on several other occasions, but stayed in the country on shorter trips in part because longer and bigger trips meant tapping into the regular savings account or charging it to a credit card. Both methods were distasteful enough that we didn't go.

Having this account that's designated for travel (and is currently costing less than the cost of lunch each day) is going to provide us with nearly $3000 a year in travel money, guilt free. We're not damaging the rainy day fund, the retirement accounts or our debt load, but can go on nice trips for that kind of money.

Now we just have to figure out an actual plan for the trip from among the huge number of options when traveling to Ireland.

Really Need to Get Away

Nov
12
2006

After several long, draining weeks, a 60,000 mile service on Shelly's car that cost $811.00 and an english muffin this morning at Baker's Square that was adorned not only with butter and a fine golden brown, but multiple spots of mold, I'm really ready for a vacation. Good thing I'm going on one.

We leave on Friday to go to Washington DC for a week or so and I'm really looking forward to it. History, politics, the Smithsonian and 60 degree days are more up my alley than 80 degree beaches and blinding sun as far as vacations go.

We've got a list of stuff we want to see and do and will be spending our time with family that we get along with pretty well. They're going to be showing us around town and helping us relax. Only 4 more days between.

So, if you are in DC next week and see someone who looks a lot like me, it's probably me.

 

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Latest Microposts

Follow Microposts on Twitter | Subscribe to Microposts

My Attendance At the Gym

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.