This won't get rid of them, but it might help cut them down.

I had a problem with fruit flies last year after an overabundence of tomatoes that we just couldn't keep up with.
I tried all the homemade traps. They worked, but not nearly as good as those ugly glue tape strip things that cost about $1 for 4.

I don't know what they put in that glue, but they loved it. Of course, it only helps keep the numbers down. You won't get rid of them completely until you take care of the source of the problem.