The regular expressions are a bit yucky, but that's to be expected. I think the rest of the code is pretty readable. Cool feature: that bit with the join and URI.escape at the top lets you use it like so:
weather san francisco, ca
"san", "francisco,", and "ca" will be passed as separate arguments, but the line at the top will join them together and convert the resulting string into something you could type in a URL bar. (ie: spaces -> %20).
Makes it easy to be sloppy on the command line. :)
No comments:
Post a Comment