Archive for the 'Unthirsty' Category

Yahoo! Geocoding now supports UK

I was working on Unthirsty last night when I came across an example of using a particular geocoding plugin. The addresses they were using were in the UK, and I was puzzled because last I checked the UK wasn’t available in any free geocoding API that I could find. So I tried out geocoding a pub in London and what do you know? Yahoo! came up with an accurate result with precision down to the address. So I tried a few more, and they all worked. This is great news, because it allows us to catalog happy hours in the motherland of pubs. I thought I’d share because apparently this has been around for a while and I didn’t even know about it. Anyone looking around for a free geocoding service for the UK, check out the Yahoo! Geocoding API. Also, if your Rails app needs geocoding support, check out Graticule, and see my snippet to make Graticule failover to multiple geocoding services.

Unthirsty Facebook App Now Live

Although it hasn’t been accepted into the directory listing yet, the Unthirsty Facebook App is now live, and you can add it to your Facebook profile. The application will show you the closest happy hours to the location you enter as your current location in your profile, and then will place the 5 closest in your profile homepage. You can also set the default location for Unthirsty to look for happy hours, if you don’t want to use your current location.

This is revision one and may have some bugs, so if you find any leave me a comment. I’ll be working on improving in the next few weeks for incorporation into Unthirsty: Level 2. One bug you may want to know about is that if your current location in your profile isn’t set it will break the app, so if it doesn’t work for you, make sure your information is filled out.

I don’t want to be a Facebook engineer right now

Awesome news came out of Facebook this week that they opened up their system to allow developers to create custom applications that can live in Facebook profiles. I checked it out and started developing my own application, but it wasn’t without a lot of hiccups on the way. My settings kept getting reset, my application kept disappearing, and the API kept giving random errors. Right now I can’t even work on it because the system lost my application and I can’t add it back in. Fortunately most of the work is done on the application living on my server, so I haven’t lost much work.

I am still excited to finish this application and see if Facebook applications take off and become a successful thing, and I’m willing to let them work out a few kinks before I can get my application up and running. I’m just really glad to not be a Facebook engineer right now.

If you have a Facebook account, be on the lookout for some cool apps, and also coming in the next few days there will be an Unthirsty Happy Hour Facebook app available that will show happy hours nearest to your location set in your profile.

Google Maps + IE PNG Hack + IE 7 = Maps Asplode

Yesterday I went to show someone Unthirsty on their home PC. Of course their PC was riddled with malware and ran like a 3-legged dog. I groaned when I saw the IE7 icon on their desktop. I had tested the site a bunch of times in IE 6, but when I saw the IE7 icon I realized I had never tested it with Unthirsty. Reluctantly I opened it and typed in unthirsty.com in the address bar…and can you guess what happens next? The map comes up on the page completely blank. Why is it whenever you go to show someone a site you’re proud of, it doesn’t work?

Originally in Unthirsty I added in a great Javascript hack that makes transparent PNGs work in IE6. This worked great in IE 6, but as you now know, it caused some problems in IE7 when using Google Maps, causing the map to be blank upon loading. If I switched to satellite view it worked, then back to the regular view, the map corrected itself. But obviously that’s not the solution I wanted. So I changed this:

  <!--[if gte IE 5.5]>
  <script type="text/javascript" src="/lib/pngfix.js"></script>
  <![endif]-->

To this:

  <!--[if lt IE 7]>
  <script type="text/javascript" src="/lib/pngfix.js"></script>
  <![endif]-->

If you’re not familiar with the weird if gte IE 5.5, it’s Microsoft’s way of letting you tell versions of Internet Explorer to use what’s in between those comment blocks. Here I’m telling it to include the pngfix.js file if the version of IE is greater or equal to 5.5. Since this also includes IE7, I changed it to include it if the IE version is less than 7. Problem solved.

I hope this helps someone that is having the same problem, but at the same time this should be a wake up call to a lot of developers out there. CHECK YOUR SITES IN INTERNET EXPLORER 7! Especially if you made any hacks to accomodate IE 6 flaws.

Unthirsty 2.0 Underway

Almost a year after launch, I’ve finally started developing version 2.0 of Unthirsty, a happy hour finder using Google Maps.

Since launching Unthirsty, I haven’t done much in way of improving it. I think of it as a way to let it sit and mature, which it has wonderfully. Both Jason Glaspey (my partner in crime) and I have discovered a few things that could be improved, both from regular use and from user feedback. But we’ve also come up with a laundry list of new features we want to add. Overall, the most exciting thing about the new and improved Unthirsty will be developing it with Ruby on Rails.

The most exciting thing about the new and improved Unthirsty will be developing it with Ruby on Rails, which I’ve come to know and love in the past 6 months while working on a few projects both freelance clients and my new employer, Instrument Marketing. Finally taking the dive and learning Ruby has been great, and working in the Rails framework has been a great experience. Creating Unthirsty 2.0 in Rails is going to make the daunting list of new features much easier to tackle. If I continued using PHP I would probably never get it done.

A few things that Ruby and Rails will dramatically help with will be:

Keeping track of data relationships
After creating the class relationship map, I counted at least 16 different relationships between entities in the application. Keeping track of all relationships and validations in PHP would have been a nightmare.
Geocoding
I’ve discovered a Ruby gem Graticule, that works with pretty much all the major geocoding services, to geocode addresses into coordinates. It also has methods to calculate distance, and even a SQL query generator that will find locations within a radius of a given point. Although Unthirsty has all this functionality currently, having this completely abstracted in another library is going to make life so much easier.
AJAX Interface to data
I’ve gained a lot more Javascript experience since I initially worked on Unthirsty, including tons of time into working with Prototype. With Rails Prototype helpers, grabbing data and plotting it on the map from the Unthirsty database will be a lot simpler. Outputting data will be a snap since ActiveRecord objects can be converted to JSON with one method. Currently Unthirsty data comes out and is processed by Javascript in a really convoluted way that is hard to maintain.

There will be a ton of exciting new features and improvements coming with this new version of Unthirsty, but we do know that we’re doing something right already. The trick is to keep that rhythm going. I think we’ll be able to.