Live data from Hacker News

Dwitter – A social network for short JavaScript demos

dwitter.net

41–50 of 74 posts

Re: Dwitter – A social network for short JavaScript demos

#42
post #31

Earlier quoted context omitted.

I tried to register as "sfz-" and also got a 500. Is there a problem with a trailing dash? If so, can you fix my username as well to "sfz"? Thanks!

Changed to sfz :)

Sweet! Thanks! https://www.dwitter.net/d/727

Re: Dwitter – A social network for short JavaScript demos

#44
So I whipped up a standalone HTML page to use to develop Dwitter scripts without having to use their interface (which seems prone to crashing). Here's the source: https://gist.github.com/russellbeattie/ef27709f7c916ea54454c... and you can see it live on my site: http://www.russellbeattie.com/dwitterish.html

Interestingly, I found that some scripts really don't like using eval(), so I modified the page to dynamically swap in new elements with the code instead, and a flag to go back and forth.

Here's an example of a script which doesn't like eval() - it runs noticeably faster when embedded in a script: https://www.dwitter.net/d/697

Edit: Added the ability to just embed the code in the URL: http://www.russellbeattie.com/dwitterish.html#c.width%7C%3D0...

(Note that I only tested this on Chrome, so feel free to modify if there's issues.)

Re: Dwitter – A social network for short JavaScript demos

#45

This is really cool, but executing other people's javascript in a page makes me nervous. What sort of restrictions are in place to prevent malicious exploits?

Makes me quite nervous too. So far each dweet is run in a sandboxed iframe loaded from a separate subdomain. There are definitely things you can do, and I'm aware of some annoying ones. I'll just manually delete them at this point. Any security conscious person would view it with noscript and just read the javascript ;)

While you're manually deleting things... there are currently way too many that are just exact reposts of the default swaying black bars. Probably accidents rather than people being deliberately lame, but low-hanging fruit for any kind of automatic cleanup.

Re: Dwitter – A social network for short JavaScript demos

#46

This is really cool, but executing other people's javascript in a page makes me nervous. What sort of restrictions are in place to prevent malicious exploits?

Makes me quite nervous too. So far each dweet is run in a sandboxed iframe loaded from a separate subdomain. There are definitely things you can do, and I'm aware of some annoying ones. I'll just manually delete them at this point. Any security conscious person would view it with noscript and just read the javascript ;)

While you're deleting stuff, I noticed someone on the new page has posted pornographic images. Alas, I'm not terribly surprised since this is the internet after all, but I'll +1 a feature to report dweets as being inappropriate.

A system to automatically hide dweets (for later manual review) after receiving a certain number of reports would likely solve the problem in the short term.

Re: Dwitter – A social network for short JavaScript demos

#47
This is awesome! During one of the last hackathons I participated while at Tumblr, I made a Processing post type, that allowed people to have interactive posts using Processing code, and could be reblogged with edits - very much like this. Love seeing something similar to this idea!

Re: Dwitter – A social network for short JavaScript demos

#50

I'm not understanding this. How is animation happening? What is S(t)? Can somebody please explain this project?

Scroll down:

  u(t) is called 60 times per second.
  t: elapsed time in seconds.
  c: A 1920x1080 canvas.
  x: A 2D context for that canvas.
  S: Math.sin
  C: Math.cos
  T: Math.tan
  R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)
Post reply on HN