While playing with Yahoo! API for text extraction I faced the well known problem of using XMLHttpRequest to fetch data from another site (cross site scripting is, by default, denied). What I was simply trying to do were fetch a page from a site of choice and then “push” it as the “context argument” of the Yahoo! query. That way I could get the “relevant” words for that document (“And then? So?” you’d ask. “I don’t know” is my answer, just playing ).
I did resort with the natural way to shut down the security constraint of Netscape/Mozilla, adding userpref("signed.applets.codebaseprincipal_support", true); in my own Firefox pref.js, and then asking the user (being myself) to accept the security risk with netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead'); in my javascript code.
But there is another, hackish and cool way to prevent XMLHttpRequest to annoy people doing “the right thing” :) I just read this article about faking the xmlhttprequest security restrinction using apache mod_rewirte. Awesome, isn’t it? Practically, you need a RewriteRule in your local Apache (where the xhr page resides) that proxy [P]ass a fake “local request” to the remote host, and the pass again the response to your script.
Yes, you also need to enable the proxy support in Apache.
Read on that article for the pesky details :)
Ever wonder how to record a work session of your web application or web site and then put it into you portfolio or give it to the client? Screenshots are ok but, hey, movies are better! So here comes vnc2swf, a really cool hack that “translates” data from a vnc session to a swf file, ready to be read by your usual Flash plugin on your browser.
Just download the sources from the vnc2swf site and compile them. Compiling requires the ming library and (probably, that was my case) a little tweack in a source file (in writeswf.c it seems that the test for the ming library version is wrong. If you get an error about the parameters of the SWFMovie_output() function, just change the file to let it always use the first function format as for ming 0.3beta1).
After that, just follow the istructions you find in the vncswf site (they are very simple). Just remember that:
- You need to run a vncserver OR the X11vnc nifty tool which translates your current X11 session in a Xvnc one
- Once a vncserver is running, the vnc2swf program acts like a vncviewer
- You can access a contestual menu while using vnc2swf, by pressing F8
- You can pass the vncserver the -geometry XxY param, so you can record a session at a lower resolution
- Use F11 in your browser, to get rid of the some useless toolbars
- To view the final swf you need to embed it via the OBJECT element into an html file
- Install the swftools program suite, and the use the swfdump program to prepare a HTML suited for your swf
This is just to report an article I did read: its title is Getting Real, Step 1: No Functional Spec and what is funny about that, is that while being pointed to that article I was writing a… functional specifications paper. I do not agree completely with the assumptions of the article, but I agree with the “Interface is the application” slogan. My reasons will simply sum up with all those present in the loooong list of comments, so I don’t bother reporting them here. Instead, I’ll quote a very smart opinion of one of the readers:
eXtreme Programming have a few good sayings about that: Do The Simplest Thing That Could Possibly Work and You’re Not Gonna Need It. Trying to guess what the evolution of the system is going to bring is inefficient at best and utterly destructive at worst. Carrying around baggage of fortune tales of one possible future is going to harm your ability to deal with the present. Worry about today today and leave tomorrow’s troubles for tomorrow.
This is just to point out an interesting article from DigitalWeb Magazine. It talks about how the www is becoming more a web of intricated and sophisticated social phenomena. This is carrying the “old” concept of web of information more closer to a web of people. Of data about people.
Web design in Web 2.0 is about building event-driven experiences, rather than sites.
The paradigm is “what is interesting me, is probably of interest to you too”. So, keep on writing tools and protocols and microformats (they are strangely left over, in the article) to share information, likes and dislikes.
Read the complete article about Web 2.0