DEV Community

PlayBossWar
PlayBossWar

Posted on

2 2

A Geoloc website for a friend

Let's start with the beginning, a friend in Ecuador got her wallet stolen, and I only knew his name.

So I started googling him a bit, found his Facebook and of course created a fake account that seems a minimum legit.
While waiting let's figure out how I can retrieve his localisation.

Remember that in some countries what I'm going to do next don't work. I tested it with my friend and the localisation gave me her exact coordinates, while in Belgium for example it gives me a location 100 km away.

I found a pretty cool Json API that allows me to get the localisation data that is linked with the ip that is used to do the request : http://gd.geobytes.com
So with a simple fetch it was really easy to get the information if someone opened my website.
Now the problem is a bit tricky, since it's a static page and I don't want to install a node-js back-end, just upload the files to a server host and done, so I decided to email the information to myself.

After a little bit of research, I found PostMail https://postmail.invotes.com/ , and it worked great.

Tried it myself and I can easily get the information in my mailbox of anyone who visits this page.

GITHUB REPO : https://github.com/titivermeesch/geoloc-website

There is just one downside, someone can simply extract the token I use to send the mails and use it for himself, but yeah, that's the risk I take to catch that thief.

Thanks for reading. Hope my first article is interesting.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️