T.L.D.R: This is a thread where we share our shit that we have made. Let it be websites, APIs, bots, pictures, what ever…
I like to create things randomly all the time, and I love showing off my work. Maybe they will be useful to others, and maybe they won’t? I figure we all have some projects like this. Something that spawns out of a hobby, or some random needs at work. Maybe they will benefit us all, or motivate us to put down our cell phones and create something we enjoy.
They can be beautiful, they can be ugly. They can be functional, or half-assed. Let it shit out 503 Errors, and have 404s on some of the links. All that truly matters is that we made something.
Can’t seem to make something, but want to share an Idea… do that to, let’s make that project come to life…
All in all, lets just share what we have made.
So firstly, let me post my IP2ASN. I wanted to make an API for the longest of times that replicates some of the features seen in MaxMind’s ASN database. This spawned out of the fact that I wasn’t fully sure how it worked, and wanted to learn how to make something similar.
The project basically had two parts; the builder, and the API service. To do this, I created two JavaScript apps. The first JavaScript app runs through a list of ASNs and grabs every ASNs list of IPs and name. I then convert the IPs into numerical ranges and shove them into a database. The interesting one was of course IPv6. To handle IPv6 I chopped off the whole client side of the range, and only cared about the first 64 bits. Which I then converted into a numeric using parseInt(ip, 2);. Slapped that lovely data into a MySQL database, and dumped the end results. After running the script for around 5 hours… Bam I have a 32 MB usable lookup database.
The API side was mostly the reverse. To do this I created a script that checks for new versions and automatically imports them hourly. Some JavaScript to reverse everything I have done above. A small detour in callback hell (not really)… and here you go:
So for a fun few day project over the 4th I am really excited, and I hope you will enjoy it!