A Ruby 30-Second Cooking Script to Fetch IPs Accessed from Within Japan
First, the Script
1 | $ git clone https://gist.github.com/kenzo0107/714ece62cf6450386ff0fb16fd5b777a |
Overview
I created this because of a request:
there were separate Japanese and overseas versions of a URL,
and when someone accessed the overseas version from within Japan,
they wanted to redirect them to the Japanese version of the site.
Using this script, I set up the redirect in the .htaccess and so on for the overseas site.
That’s all.
