You can get rid of fruit flies by using a fruit fly trap of red wine or banana or apple cider vinegar. You can also get rid of fruit flies by quickly cleaning up any spilled beer or fruit juices instantly. For more information check out http://www.ehow.com/how_2002530_rid-fruit-flies.html.
I've used the recommended vinegar in a funneled makeshift bottle, and it works. You just have make sure there isn't many places for them to land around the top edges of the trap. That's the place I saw them congregating the most, so I just got out my vacuum cleaner and wah-la!
Get a two-liter bottle, cut the top off, fill it with fruit and put a funnel with a small(ish) hole on the top of the bottle. This way, the flies will have a straight way in but they wouldn't figure out how to get out.