Category Archives: My Scripts

Post navigation

Since v2.x SDK, Facebook require apps to go through Login Review process if the app need to access to News Feed. I tried to submit HTML5 Word Cloud two times but repetitively I got the same response:

read_stream – Unapproved

The read_stream permission is only approved for apps that let people use Facebook on platforms where Facebook is not already available.
If you’re building an app on Android and iOS, for example, you won’t be approved for this permission. Web, Desktop and TV apps will also not be granted this permission.

With v1.0 SDK to be turn off on April 30th, 2015, that means the app will lost it’s ability to access people’s News Feed on that date.

HTML5 Word Cloud is a Web technology demonstration, it uses JavaScript/DOM to render user input in a tag cloud, all within the browser. No user data is collected because user data never leaves the browser. It’s all written in the privacy statement, and the code base is open sourced.

If you think this app deserves access to News Feed and you happen to know someone who could help, please point them to this post. Thank you.

Due to performance considerations, I’ve removed IndexedDB dependency completely from JSZhuyin, the Chinese IME implementation entirely in JavaScript. The program now do searches entirely in the memory with pre-built binary data (the data is built with node with JavaScript too). In order to future-proof the development I’ve enabled Travis CI to run tests with SlimerJS too. For those of you who is not familiar, SlimerJS is the Gecko (Firefox) equivalent of PhantomJS, which allow you to control a browser instance (e.g. to run a QUnit test page in this case) with JavaScript API.

Why not PhantomJS?

For starter, I don’t hate PhantomJS because it’s not Gecko. I love the tool and it’s pioneering idea, but the shipping version lacks of a lot of browser APIs needed for my project to run. It does not come with Function.prototype.bind (reason given here); nor I have no idea the version of WebKit it is shipping with, given the fact it comes with ArrayBuffer interface but without other basics like Uint16Array. Since JSZhuyin rely on these interfaces to work on binary data, I would have to set up the CI with anything other than PhantomJS.

The setup

If you are looking to run PhantomJS and QUnit, the grunt-contrib-qunit task is so easy to set up and it’s probably not warrant a post here. For testing on SlimerJS, I’ve turned to the grunt-shell task instead and run it with a shell script. Without messing up the format of the post here, please refer to the actual setup:

The first problem I hit was that SlimerJS does not return exit code due to Gecko constant. tee the output to a file and grep it solve the problem. The last small glitch I encountered when I push everything to Travis CI was the fact $TMPDIR directary is not actually writable in their VMs; so I moved the temporary file to the working directory instead.

Conclusion

I hope this post will help you get everything running. Web testing and automation is a gigantic topic in which I’ve just starting scratching it’s surface; sometimes I wish there should be a simple tool where you could set it up and forget it, but I still enjoy the alternative process before that show up.