Optocoupler Question
If you download the datasheet from the site you linked to (Downloads tab, fifth one over), you'll see that in the Input section of the Electrical Characteristics table on page 2, the forward voltage V\$_{F}\$ of 1.5V is specified at a current of 5 mA I\$_{F}\$.  50 mA is from the Absolute Maximum Rating, you don't want to use that.  So the resistor value you want is:

$$\frac{(3.3V - 1.5V)}{5mA} = 360Ω$$

not 39Ω as you assumed in a comment to another answer.

The Raspberry Pi GPIO pins can sink or source up to 16 mA (the output is configurable from 2 to 16 mA). I covered that in an answer to another question.