Live data from Hacker News

How we used Node.js to build real-time award flight search

blog.milewise.com

11–20 of 39 posts

Re: How we used Node.js to build real-time award flight search

#11
post #8

they'd do much better with twisted (python) than tornado. using Deferreds is nothing like opening keys with a beer bottle -- it makes a lot of sense. and as a former ITA Software employee, i can scoff and say they aren't actually doing anything resembling flight search. they're just scraping websites and APIs. node.js might be fine for that, but so is anything else. at that level it's more a matter of preference than…

There are deferreds in node as well.

Re: How we used Node.js to build real-time award flight search

#12
post #2

Great use case for Node.js.

Great use case for Twisted, Erlang, Ocaml/Lwt, Lua, Python/Gevent too.

Great point! I bet that now thanks to your razor wit, dcaylor will think twice before saying something nice about node without also saying something nice about every other programming platform.

Re: How we used Node.js to build real-time award flight search

#13
So does milewise scrape the airline sites for award travel? Does it also integrate with ITA or similar?

I ask because (1) the airline websites tend to be _really_ slow and (2) they tend not to find the cheapest/best flights - an ITA search can often beat them.

Re: How we used Node.js to build real-time award flight search

#14

So does milewise scrape the airline sites for award travel? Does it also integrate with ITA or similar? I ask because (1) the airline websites tend to be _really_ slow and (2) they tend not to find the cheapest/best flights - an ITA search can often beat them.

We actually do both, and then spent a few cycles de-duping etc.

1) Part of our reason for using Node+Socket.IO is to deal with the problem of having a bunch of different sources returning data over a wide spread of time.

2) You'd be surprised about the airline sites. While they don't necessarily have the widest variety of good fares, airline will often reserve their cheapest fares for their own sites (called Last Seat Availability).

Re: How we used Node.js to build real-time award flight search

#15
post #14

So does milewise scrape the airline sites for award travel? Does it also integrate with ITA or similar? I ask because (1) the airline websites tend to be _really_ slow and (2) they tend not to find the cheapest/best flights - an ITA search can often beat them.

We actually do both, and then spent a few cycles de-duping etc. 1) Part of our reason for using Node+Socket.IO is to deal with the problem of having a bunch of different sources returning data over a wide spread of time. 2) You'd be surprised about the airline sites. While they don't necessarily have the widest variety of good fares, airline will often reserve their cheapest fares for their own sites (called Last Sea…

Thanks ... looks like it's time to sign up for MileWise!

Re: How we used Node.js to build real-time award flight search

#16
post #10

Could you describe the difficulties you encountered with Tornado and asynchronous Python code?

Don't want to turn this into a Node.js/Python flame war (we love Python as well here at MileWise), but regarding asynchronous Python code: It's more just an annoyance of the language. Specifically, anonymous functions are must easier in JavaScript, so it was just easier to write read and write maintainable code. In Python, you are limited to only passing in simple lambda functions (although deferreds do get around th…

>> It's more just an annoyance of the language. Specifically, anonymous functions are must easier in JavaScript, so it was just easier to write read and write maintainable code.

That's pretty specious. You can easily write a function defined inside a function that you can pass by just naming it. "Anonymous" functions are just syntactic sugar. Furthermore, writing a new python named function is easier (fewer chars) to write than a javascript anonymous function, so the "sugar" gained is moot.

Finally, as you build more and bigger systems, you realize that those multi-line anonymous functions you had you actually want to be named (for documentation) and tested. So you'll end up de-anonymizing the complex (multi-line) ones anyway.

As for speed, why not compare a jit (v8) to a jit (pypy) ?

Re: How we used Node.js to build real-time award flight search

#17
post #16
post #10

Earlier quoted context omitted.

Don't want to turn this into a Node.js/Python flame war (we love Python as well here at MileWise), but regarding asynchronous Python code: It's more just an annoyance of the language. Specifically, anonymous functions are must easier in JavaScript, so it was just easier to write read and write maintainable code. In Python, you are limited to only passing in simple lambda functions (although deferreds do get around th…

>> It's more just an annoyance of the language. Specifically, anonymous functions are must easier in JavaScript, so it was just easier to write read and write maintainable code. That's pretty specious. You can easily write a function defined inside a function that you can pass by just naming it. "Anonymous" functions are just syntactic sugar. Furthermore, writing a new python named function is easier (fewer chars) to…

Writing functions inline is a huge win, not just because of the number of characters you have to type.

It creates less noise and busy work in your code.

Explicitly specifying functions like having to pre-declare all your variables at the top of your scope.

Re: How we used Node.js to build real-time award flight search

#19
One comment: I typed in an email/password and right away it is asking me for my airline credentials but it isn't explaining what it is that the site wants to do with them or if it will store my info and collect information from now on. I'm curious about the site, but I thought twice about entering my info and skipped it. Just saying you might want to explain what it is you are doing to make people more comfortable.

EDIT: This information does seem to be covered in the FAQ, but you don't see the link to the FAQ anywhere when you are trying to capture user accounts on initial signup: https://secured.milewise.com/faq

Re: How we used Node.js to build real-time award flight search

#20

One comment: I typed in an email/password and right away it is asking me for my airline credentials but it isn't explaining what it is that the site wants to do with them or if it will store my info and collect information from now on. I'm curious about the site, but I thought twice about entering my info and skipped it. Just saying you might want to explain what it is you are doing to make people more comfortable. E…

Great feedback - we weren't sure whether at this point people would have a clear idea from the homepage of what we were doing w/ the info and they'd just want to get on with things, or if they'd want more contextual explanation.

This is definitely an area for metrics and user testing, but probably better for us to err on the side of caution =)

Post reply on HN