Friday, September 12, 2008

Open Source - Playing with Ubiquity

Well, it's time yet for another blog post, fortelling more "nightmares" with... Open source.

This time, I got into a little Mozilla Firefox 3.0 addon called Ubiquity. It is a program that allows you to type commands and Mozilla will do things with them regarding web pages and such.

For instance, typing wikipedia LOL inside of its command-line will open a wikipedia page for LOL.

However, it is pretty limited. It can only do certian things at first, but seeing how Firefox is open-source, other poeple starting making Ubiquity commands to make it do interesting things. You can make it search for NASDAQ quotes, search on Mininova.org for certian torrents, or activate a search engine to search for images or such.

I did something relatively simple. Benny Sheerin created an open command. I took it and rewrote parts of it to make a goto command using Javascript (the base language the Ubiquity commands are written in). It works like a Hash Table in Perl programming. There would be a key (an alias or keyword), and then would be a value associated with it (in this case, a webpage). 

When you have so many favorites pages or you dont have the hard drive space to store these pages on your PC, then this little add-on is right for you. All you need to do to add a new page, is create a new key-value pair inside the Javascript program. And then re-add it to the Ubiquity command list.

The biggest problem I ran into was compiling it. I did read over Benny's existing code well, it's just - I personally SUCK at Javascript. I hate the language personally, it was the sole reason my hopes of getting an A in INT222 went down the tube. So I had to perservere :( . JSLint (JS Compiler) wouldn't cooperate on a couple of lines and was giving me odd errors. After sitting in front of the PC for about 3 hours, and a few rounds of PSO, I managed to get it operational

I am definitly interested in this program and it's capabilities. If I write another program for this, I would make it so you can type in a word, and then a forum (running on vBulletin) and it would open the Search results to said forum. The only problem with this: You may need to log onto said forum, so you can use the Search tool. And I would also have to write it so it either shows results as threads, or posts. To start, I would need to find an existing search program, and rewrite it to search on boards instead of search engines.

If you wish to gain access to the Javascript code and use it for yourself, or you wish to "borrow" it and use it for your diabolical and/or productive schemes, you may find it here, along with other scripts written by my fellow comrades.

No comments: