Skip to content

Instantly share code, notes, and snippets.

@soopa
Created December 29, 2013 01:28
Show Gist options
  • Save soopa/8166439 to your computer and use it in GitHub Desktop.
Save soopa/8166439 to your computer and use it in GitHub Desktop.
A bookmarklet to calculate an Airbnb stay total (subtotal + Airbnb service fee) and cost per guest and per couple. Example: http://cl.ly/image/2i310X2i1W3H
javascript:(function(){var subtotal=parseInt($('%23subtotal').text().replace(/\$/g,''));var fee=parseInt($('%23service_fee').text().replace(/\$/g,''));var guests=parseInt($('%23number_of_guests').val());var total=subtotal+fee;var total_per_guest=total / guests;var total_per_couple=total_per_guest*2;$('%23show_more_subtotal_info').html("Total: $"+total+"<br>Per Guest/Couple: $"+total_per_guest+" / $"+total_per_couple);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment