Collect IP Address background information for WebLog

Lucas Jellema
0 0
Read Time:1 Minute, 2 Second

We collect information about all visist to our weblog. We know for example the IP-address for every visitor. It would be interesting to also have the Country for these visitors – so we know who we are catering for. I have created a table WP_VISITORS:

mysql> desc wp_visitors;
+------------------+------------------+------+-----+---------+-------+
| Field            | Type             | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------+-------+
| ip               | varchar(15)      | YES  |     | NULL    |       |
| first_visit      | datetime         | YES  |     | NULL    |       |
| number_of_visits | int(10) unsigned | YES  |     | NULL    |       |
| country          | varchar(50)      | YES  |     | NULL    |       |
| continent        | varchar(20)      | YES  |     | NULL    |       |
+------------------+------------------+------+-----+---------+-------+

in the WordPressDB database. Now I want to set up a daily Java action that will update Country and Continent for the top 100 visitors among the records that have not yet had there country set. This Java action can make use of the IP WebService described in this post: How to lookup information based on IP address – e.g. for Website-visitors

For development, it is more convenient to have the wp_visitors table with test-data available in my local (Oracle) database. I export the table from the WordPressDB database on our Linux-server using this statement:

mysqldump -p --where='number_of_visits>50' wordpressDB wp_visitors > visitordata.txt

The resulting visitordata.txt file can easily be transfered to my laptop computer.

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Next Post

Templates in Oracle JDeveloper

Chris Schalk has posted a very interesting blog on web templates in JDeveloper 10.1.2 (production) and JDeveloper 10.1.3 (preview). This how-to is only published on the Chris Schalk’s blog This will surely increase your productivity, when working with custom designs Related posts: ADF Faces – The Next Really Big thing […]
%d bloggers like this: