Behind the Scenes
More complex/specific portions of the Tweetanium code are placed in separate files, but a similar pattern is followed and the code is added into the appropriate namespace under the pre-existing Tweetanium object (e.g.) tweet overlays, scrollers, etc. Lastly, there are also files whose names correspond with the window that are utilized in (e.g.) index.js & login.js. These files mostly contain some initialization code and window specific event handlers.
In order to interact the Twitter API beyond simple searches (e.g.) tweet, reply, retweet, follow/unfollow, etc an application will need to utilize OAuth/xAuth. Tweetanium utilizes xAuth and does it’s integration via SpazCore. Below are the basic set of methods created in Tweetanium to deal with Authentication (Note: these are taken out of context so review the full source for the actual implementation).
Taking Advantage of CSS3 & Webkit
-webkit-box-shadow: 3px 3px #888;
-webkit-box-shadow: inset 0 0 2px 2px #888;
Another common task required in many desktop applications is posting system notifications. Titanium Desktop makes creating system notifications simple and they look great across the various environments. They integrate nicely with Growl, Snarl, etc and generally have basic fallbacks in place for when these more advanced notification systems are not available. Tweetanium uses system notifications to indicate when new tweets have been found and creates a menu item that allows for the notifications to be enabled or disabled at will. Here is the basic code used to create & display the notification:
The resulting notifications look like:
Some additional notes on this:
- In our case jslint is disabled when running via juicer because some of the external libraries fail to lint. The Tweetanium files themselves are linted separately.
- Spazcore is included separately and not pulled into the juicer dependencies because it defines it’s own set of dependencies and we are using a prebuilt version of SpazCore for Titanium.
Our goal with Tweetanium is to provide a useful set of projects that developers can learn and pull from as needed. Tweetanium is not necessarily a full blown Twitter client although it does implement much of the functionality found in a number of popular clients. We’ll continue to refine & improve the application over time and use it to show off other platform features. Below is a short video of the application in action. Source code and downloads coming shortly…