Comments/Ratings for a Single Item
I started using a service that allows 150 requests per minute, and I rewrote the code to make only one request per ip address. The database presently has data on 2475 ip addresses, and they span Africa, America, Asia, the Atlantic, Australia, Europe, and the Pacific. North and South America both get classed as America, the Middle East is grouped with Asia, and the timezone for Hawaii is Pacific/Honolulu, not America/Honolulu.
The service I'm using to get ip address information allows no more than 1000 requests per day from free users, but when I checked the IPAddresses table today, it had over 2000 entries, about 3/4 of them blank. This was to be expected given that I was making two requests per ip address, one for timezone and one for country. This also underscores how important it is to build a local database I can query for this information instead of always querying an external site. And it means it is going to take some time before it can get ip address information on every visitor.
Comment dates should now be displayed in your own timezone. This works by looking up the timezone for your ip address. It also builds a database of ip addresses with country and timezone information to reduce the need to consult an external site. Since I can't travel around the world, let me know how well this is working for you.
6 comments displayed
Permalink to the exact comments currently displayed.
The database now has over 10,000 IP addresses, and every state in the United States is now represented.