Update tripadvisor.py

broke the code out into separate functions for usability/readability