Tip of the day: simulate geolocation in chrome

Plus day 1 of Rails project week

Leibel Hecht
Jul 24, 2017 Ā· 2 min read
We’re building a StubHub clone! logo copyright stubhub.

We’re building a stubhub clone in Rails and we’ll be testing the local events feature. Here’s how we’re going to do it.

Howdy wonderful people! This week at the dojo (my last week btw šŸ™), is project week and we’re building a StubHub clone in Rails. One of Stubhub’s features is the ability to see local events based on the user’s location. The app will grab the users geolocation from their browser and send it to the backend to then serve the right events. But how will we test that the location feature is actually working? Using a vpn to change our IP address won’t help because we’re getting the location using HTML5 geolocation, not from the IP address.

Luckily, the chrome developer tools include a great little feature to do this.

Here are the 4 simple steps:

  1. Open Chrome Developer tools
  2. Click the 3 dots and open console drawer
  3. Click the 3 dots in the console drawer and open sensors.
  4. Change the geolocation. Thats it!

Here is a quick demonstration.

Use sensors to change geolocation

I hope you enjoyed today’s tip. Until next time, happy coding šŸ˜Ž !

I am looking for an opportunity to join and contribute on a tech team, and I’d love to chat. I’m on Twitter, LinkedIn, Medium, Github or plain old email @ leibelhecht@gmail.com. My Portfolio is at leibelhecht.com

My Coding Journey

Follow my coding journey and my experience at Coding Dojo in Chicago

Leibel Hecht

Written by

I’m Leibel. I’m transitioning from Talmud to Tech. Maybe someday I’ll be the Rabbi on Rails :)

My Coding Journey

Follow my coding journey and my experience at Coding Dojo in Chicago

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade