It's a service I set up for the last post.
Here's the code:

import time
if __name__ == '__main__':
  print "Cache-Control: no-cache, must-revalidate"
  print "Content-type: text/plain\n"
  print time.time()

Eyal.

On Mon, Feb 8, 2010 at 2:33 PM, pamela (Google Employee) <
[email protected]> wrote:

> Agreed, I was just thinking the same thing. Is that your App Engine
> app? (Will it remain up as a reliable service?)
>
> Thanks for sharing the code!
>
> On Mon, Feb 8, 2010 at 7:49 PM, eyalzh <[email protected]> wrote:
> > The way I see it, to overcome the differences between local clocks you
> must
> > use a robot or a web service that will tell you the time.
> > The gadget will make a request to that service whenever it is rendered by
> a
> > client. Thereafter it will just tick using javascript.
> >
> > Here is an example of such a service:
> > http://everybodywave.appspot.com/whatisthetime.py
> >
> > Javascript code that can sample it within a gadget:
> >
> >      var sharedTime = null;
> >
> >      var timeServerUrl =
> > 'http://everybodywave.appspot.com/whatisthetime.py?ts='+new<http://everybodywave.appspot.com/whatisthetime.py?ts=%27+new>
> > Date().getTime();
> >      var params = {};
> >      params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> > gadgets.io.ContentType.TEXT;
> >      gadgets.io.makeRequest(timeServerUrl, onTimeServerAnswer, params);
> >
> >      function onTimeServerAnswer(answer) {
> >        sharedTime = parseInt(answer.text);
> >        startToTick();
> >      }
> >
> > The use of the parameter "ts" in the query string of the request is
> needed
> > in order to disable the cache of makeRequest(). You can use a random
> number
> > just the same.
> >
> > On Mon, Feb 8, 2010 at 3:38 AM, qMax <[email protected]> wrote:
> >>
> >> [sorry for fingeroughness]
> >>
> >> i'ts quite reasonable to make installer gadget instance to alarm
> >> robot,
> >> in hope that installer/moderator will not close the wave or
> >> disconnected beforehand.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Google Wave API" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<google-wave-api%[email protected]>
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/google-wave-api?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Wave API" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-wave-api%[email protected]>
> .
> > For more options, visit this group at
> > http://groups.google.com/group/google-wave-api?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Wave API" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-wave-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-wave-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.

Reply via email to