Realtime Web Messaging over Animated Gifs
github.com
github.com
Someone made a coffee table out of old crates? Pin. Someone made a fence out of old wood pallets? Pin.
Someone made a realtime messaging library out of animated gifs? Upvote.
... - transitors - vacuum-tubes - water - crabs - ...
That's the way to get the good stories onto the front page.
A hack would be taking the input of a TV tuner card, converting the video to .gif frames, and printing that out slowly enough to view a slow video over a DSL line to watch TV without a media player.
No True Scotsman: Hacker Edition?
I simply made an amusing (to me) observation. I had earlier thought Pinterest seemed like MacGyver for people into crafts (at least that's the kind of thing my wife kept getting excited about). That's not to disparage HN or Pinterest or MacGyver for that matter.
I am in the south and can confirm we are also in September, will report back with news.
/snark
And an australian christmas in June, but it would be worth it!
So he wrote a digital clock that used standard-length seconds, but 70 of them per minute, 60 of those minutes per hour, and 24 of those hours per day. So when it was 10:30:59 by his nonstandard clock, he was at the phase of his nonstandard day that corresponds to 10:30 or so of the standard day --- but the clock would then roll over to 10:30:60, 10:30:61, ... 10:30:69, 10:31:00.
It was very amusing to see people's reactions upon watching the clock for a little while, especially at the time of week that it was more or less in phase with normal time.
It's an awesome hack, cool to see it being rediscovered/reinvented after so much time!
Wayyyyy back in the day (NS4, IE4 day) I used the width / height of an image the browser polled every few seconds as a transport mechanism... the only other option (refreshing a hidden frame) caused an irritating "page refresh" clicking noise. This was before XMLHttpRequest obviously and was enough bandwidth for our needs. It worked so well that I believe its still being used in production systems.
I haven't looked at the javascript generated in this animated gif solution, but I assume that it does some stuff that wouldn't work in the pre-IE6 browsers. It would be extremely amazing if it did though.
<img src="test.gif" id="img">
<script type=text/javascript>
var img = document.getElementById("img");
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
</script>
Then you can do whatever you want with the pixel data.This eventually got open-sourced as "mod_pubsub".
Roughly, use scrot (or similar screen capturing command line tool) to take a screenshot of the desktop and then encode it into a gif frame. Repeat once per second. Boom, your desktop is now a gif.
The main problem with this approach is that transmitting stuff via gif (low-color bitmaps, remember) is painfully slow even with modern internet.
That said, could probably be very useful in some instances!
[1]: "Some economy of data is possible where a frame need only rewrite a portion of the pixels of the display, because the Image Descriptor can define a smaller rectangle to be rescanned instead of the whole image." https://en.wikipedia.org/wiki/Graphics_Interchange_Format#An...
[2]: https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Wel...
1) live charts and graphs of server loads
2) interactive maps (instead of loading new images, just append)
3) I'm also thinking of some kind of captcha, where the user waits for the server to show a certain image and then can submit a comment and the server would know which submits were valid based on timestamp... or something.
4) weather, temperature, stocks
5) collaborative drawing applet? (would still require ajax though)
More like: Hit submit when a picture of a dog is shown in the slideshow, if its a cat, your comment will be denied. And these images of dogs and cats would be picked randomly by the server from a google image search (...or something). The vulnerability so far is that a bot could just keep trying until it got in but I'm sure a crafty programmer could come up with an attempt limiter.
Still a half-baked idea, but the tech does offer some interesting possibilities. I particularly like that this may work when AJAX/JS is disabled or otherwise not an option.
That said, I am a complete amateur at captcha design. Cool research though and I bet a lot of HN'ers would be interested in your PoC if you haven't already submitted it.
[1] http://orvtech.com/en/general/gobierno-venezolano-elecciones...
Founder of camarades.com / ww.com, creator of the first 'streaming webcam software'
see: http://news.ycombinator.com/user?id=jacquesmAll that aside, this is amazing.
That said, it seems that since the "digital revolution" we go through these re-inventions of basic ideas and tools quite frequently. We've had "email" since the time multiple people could use a computer; recently, I commented on HN about how someone reinvented server log analysis tools to find click fraud (they were outsourcing analytics and apparently were unaware that web server logs ever existed.)
However MSIE6 also supports XmlHttpRequest (though an Active-X Control), which you can also use for real-time communication. Just setup a XmlHttpRequest and let the request idle on the server-side until new data become available.
See:
http://en.wikipedia.org/wiki/Asynchronous_I/O
http://www.slideshare.net/joshzhu/nginx-internals
http://www.aosabook.org/en/nginx.html
http://serverfault.com/questions/86674/why-is-nginx-so-fast
Also, Node.js.Edit: formatting.
Kinda:
> if we add an animated GIF as the first source, every time a drawImage call happens it will render whatever the status of the GIF is at that very second
So if you call drawImage in a (timeout/setinterval) loop, you can get the frame's data, compare to the previous frame's data and if they're different you got a new frame-worth of data.
Considering that requires canvas support (with image-query capabilities) you're probably better off using websockets and the like.
Imagine the possibilities !!11!1
Once the WWW kicked off and GIFs started being served, and especially once cgi scripts started being written, someone could have had this idea and the software and hardware probably could have handled it. So we could have been doing this in the late 90's. I wish I had thought of it...
Thoughts?
how do I decode my data from animated gif in javascript?
Very clever
IE6, are you serious?