Grabbing the date from the Internet

Previous topic - Next topic

FutureCow

I'm writing a program that I want people to be able to run, but a certain part won't work until a given date (their birthday).
I'm going to do a date check ( PLATFORMINFO$("TIME") ) but want to protect against them being clever and changing the system clock.

I thought I'd do a NETWEBGET to grab the date off an internet site (timeanddate.com) - but the date there (and similar sites I've looked at) is implemented via javacode, so a NETWEBGET will get the code and not the time (at least that's what I assume, I can't test at the moment as I'm behind a proxy server and NETWEBGET doesn't work for proxies where you have to type in a username and password).

Does anyone know of anywhere online that statically update their page with a date that will be easy to parse with NETWEBGET? The ones I've found that have a static date (like my local news site) have too much data to sift through.
This is only for a small app that will be run a few times for family over the next couple of months, so it's not putting any load on anyone's internet server.

If anyone has any ideas on a better way to do it too I'd love to hear it.

Moru

That is easy if you have a homepage, paste this into a textfile and upload on your server as "date.php":
Code (glbasic) Select
<?php echo date('Y-m-d'); ?>

I did this on my homepage:
http://gamecorner.110mb.com/date.php

FutureCow

Sorry, I should've put in my post that I don't have webspace - that's why there's a problem. It would've been easy if I had my own site.

FutureCow

#3
I'm also hoping to pull the date off a popular internet site as there's less risk of it being unavailable at the time or disappearing in the next 4 months that I need it for.

MrTAToad

My one will last for at least a year, if thats any help :)

FutureCow

Thanks MrTAToad! If no one comes up with any other ideas, I might take you up on that. As mentioned, it's will only be queried a handful of times so it won't chew up enormous quantities of bandwidth.

MrTAToad


FutureCow

I'm currently trying to query from an NTP source directly but am hitting problems with SOCK_TCPCONNECT blocking, and needing a way to pass a username and password to a proxy server. I'll see if I can get NTP working first.