I recently received an emailer from Onnit Labs that included a Countdown Module Timer inside the emailer using a gif image. The emailer can be viewed here: https://www.onnit.com/emails/lastchance-historic/
The Image can be seen here:
I looked into it, and it seems you can keep sending new frames to an animated GIF using gifsockets, as a GIF doesn't specify how many frames it has when loaded in the browser. Here it is on github: http://github.com/videlalvaro/gifsockets
I thought this was pretty interesting and a cool effect indeed. Does anyone have any other insights on how this could be accomplished? It seems as though the one they're using at Onnit seems to change the countdown according to date appended at the end of URL or image.
onnit.com/emails/_modules/timer/?end=2012-12-27+00:00:00&dark=1
I'm trying to accomplish the same thing to send in an email, but I am a little stumped.
While maybe gifsockets
would work (I haven't tried that before...), there is no network traffic while I am looking at the image other than the initial image load. I am also seeing it it jump from 41 to 42 again. A Reload took it down to 39.
It appears to be just a script that generates 60 frames of animation and sends them to the user. This could probably be done in any language.
Here is how it is done in php: