Linear resistance through optocoupler

Would it help much to just get a real optocoupler? Would this work?