How about something along the lines of this:

Procedure/pseudo code:
1) The two rubber gripper arms grab a bottle
2) The little arm drops until the cap grabber is on the cap
3) The cap grapper grabs the cap (in whatever way, something rubber I guess? perhaps using a rubber bladder filled with air to grab and then emptied of air to release it? small pneumatic pumps are easy to get/salvage(food savers have a good one

)
4) Servo or Motor spins the cap grabber which in turn also twists off the cap
5) Have a high torque 180 degree servo turn the bottle
slowly* until all the way upside down over the cup(which means the arm is going to have to keep itself over the cup or the cup is going to have to keep itself under the bottle. (easy to do with some simple short range rangeFinders attached the the arm. Rangefinders get an (X,Y) of the cup where (0,0) is directly under the bottle so your gunna have to do some math if you use this idea b/c the source of the liquid is going to be moving as the bottle rotates on its Z-Axis... really not that hard if you think about it)
6) Hold for 3 seconds to allow last drops to exit bottle
7) Raise the little arm so that the cap grabber isnt in the way

Return bottle to upright position
9) Rotation arm base so that bottle is now located over recycling recepticle
10) Release Bottle
11) Return arm to standby position
12) Return to step 1 upon request
*So not too much flows out too quickly, just like you would poor it yourself
Not TOO descriptive that im doing all the designing for you (although I would like to and would probably have gone into more detail if I wasnt also playing a game on my second monitor

) yet descriptive enough to get your noggin churning

Hope this helped!