https://hookrace.net/blog/time.gif/ HookRace Blog Posts Feed DDNet Me Switch Theme time.gif 2017-08-11 * Haskell * Programming This is an endless GIF that always shows the current time in UTC: time.gif (reload if it fails) Source Code (From reports it doesn't seem to work on Safari, other browsers should be fine.) time.gif is written in Haskell and works by dynamically generating each frame of the GIF and slowly feeding them over the HTTP connection. There is no guarantee that this GIF shows a reasonable time and this is just for fun anyway, so better don't build your next project based on the time from this GIF. If my server is overloaded, you can try compiling it yourself and run it locally. Update: Optimized, runs at less than 1% CPU with 500 simultaneous connections open, LZW encoding reduces bandwidth from 4 KB/s to 300 B /s. -- Wait for incoming connections and start delivering a GIF to them loop :: Int -> FrameSignal -> Socket -> IO () loop delay frameSignal sock = do (conn, _) <- accept sock forkIO $ body conn loop delay frameSignal sock where body c = do f <- receiveMSignal frameSignal sendAll c $ msg $ initialFrame (delay `div` 10000) f nextFrame c nextFrame c = do f <- receiveMSignal frameSignal sendAll c $ frame (delay `div` 10000) f nextFrame c msg content = B.intercalate "\r\n" [ "HTTP/1.0 200 OK" , "Server: gifstream/0.1" , "Content-Type: image/gif" , "Content-Transfer-Encoding: binary" , "Cache-Control: no-cache" , "Cache-Control: no-store" , "Cache-Control: no-transform" , "" , content ] This is cannibalized from gifstream, which lets you play snake and have people watch a GIF livestream. It was actually created as a Christmas exercise for students of the Programming Paradigms course at KIT. snake Discuss on Hacker News (2022-10-27) (previous thread from 2017-08-12) Related Posts * macOS Setup after 15 Years of Linux 2021-12-26 * Quest for the Lost Home Server 2019-10-15 * Chinese Traffic to time.gif 2019-05-21 * Linux Desktop Setup 2019-01-15 * Theme Switcher in Nginx 2019-01-09