LWP::Simple for Perl 6

During the last Perl 6 hackaton in Oslo, I got to meet in person some very cool folks from the Perl Community, and we had a lot of brainstorming fun, as usual.

I went there with the ambitious (and out of my skills, most probably) goal of implementing a Socket interface for Perl 6. Talking to the various smart folks there, I realized that we didn't need to write that much, because Parrot, on which the current Perl 6 implementation is based on, already had sockets support.

After much nagging, I wrote a quick & dirty wrapper that mimicked the existing Perl5's IO::Socket library, that Carl and Martin improved. And on top of that, we were able to write a really tiny LWP::Simple-like class for Perl 6.

Now it's on up on github, go fetch it!, before it's too late :)

And finally, Ubiquity for Opera v2.0!

Yes, I'm still working on this. It's so cool… :-)

This version, named 2.0, is a partial rewrite that allows most native Firefox Ubiquity commands to run unaltered. If you like Ubiquity, check out the UserJS forum announcement, or read the help page (with screenshot).

Download Ubiquity.js v2.0 and if you have suggestions for new commands, tell me!

Yet another post about Ubiquity

Yeah, sorry, but it's so exciting… :-)

In my development version now I'm able to run unmodified Firefox Ubiquity commands!
Yes, original Firefox Ubiquity JS commands can be run in the Opera version.

That's great! Of course, not all of them can work. Most of the Ubiquity internal objects are mocked, but nonetheless they work. So now I'm going to rewrite the command list as they were pB]native[/B] ubiquity commands and adapt all the code to this new structure.
This is an example of a native Ubiquity command:


CmdUtils.CreateCommand({
  name: "validate",
  icon: "http://www.imageboo.com/files/uhee2ii315oxd8akq0nm.ico",
  description: "Checks the markup validity of the current Web document",
  preview: "Sends this page to the W3C validator",
  execute: function() {
    var url = "http://validator.w3.org/check?uri=" + Application.activeWindow.activeTab.document.location.href;
    Utils.openUrlInBrowser( url );
  }
})

Cool!

Ubiquity for Opera 1.0 released!

The "nightly experiment" now is something more. Actually I am very surprised to see the amount of stuff I could do with "just" user javascript. It's already beyond my initial thoughts.

So now the plan is to convert it to a widget and get the full widget power, XHR, notifications, sticky preferences, and all that. Then, to complete the Opera version, I would only need to load real Ubiquity command RSS feeds. But that's probably not going to happen anytime soon…

Download Ubiquity for Opera v1.0

The usual warning about the default ubiquity shortcut, CTRL + SPACE, which is used by default in Opera as "homepage" shortcut. You have to remove it, or modify the javascript to assign it another shortcut.

Enjoy!

Ubiquity for Opera – UPDATED

Check out an update to the last post about the Ubiquity for Opera project I just started.

This is getting more serious than even I expected. At this point, you can see that it's not like the real thing yet, but it starts to be reasonably cool. For me, this is already past my best expectations.

If you install and try it, please give me your feedback and, most important, if you have some cool commands you want to add, just tell me. Opera's UserJS can't do everything though. They can't access remote sites via XMLHttpRequest because of security reasons.

But even with this limitation, I think the result is worth a try. Anyway, I realize that the power of Ubiquity is really the power of the Opera's location bar and custom searches, which are already builtin in every Opera standard browser :-)

There's one really nice feature in the translate command, and it's that it can automatically translate for you 3 kind of inputs:

  • the text you enter at the prompt
  • if no text, the selected text on the originating page
  • if still nothing, the current window (by URL)

This solves all my translation needs! :-)

Command list follows:

  • amazon-search
  • answers-search
  • ask-search
  • back
  • bugzilla
  • close
  • command-list
  • define
  • ebay-search
  • flickr
  • google
  • gcalculate
  • help
  • image-search
  • imdb
  • lastfm
  • map
  • msn-search
  • myopera-blogs
  • myopera-photos
  • new-tab
  • opera-config
  • opera-cache
  • print
  • refresh
  • search
  • skin-list
  • translate-no
  • weather
  • wikipedia
  • yahoo-answers
  • yahoo-search
  • youtube

Enjoy!

ubiquity.js

Ubiquity for Opera


I think Ubiquity is a pretty cool project, probably a bit overrated, but …
I thought it would be nice to try to build something like that for Opera, and learning UserJS along the way.

I managed to get the basics working. Right now, there's only one command, tran-no which takes you to the Google Translate page from Norwegian to English. If you have selected some text before bringing up "Ubiquity" (CTRL + SPACE), then typing tran-no + ENTER will translate that text for you.

Now I was trying to make it replace the text inline inside the page, instead of popping up a new tab with the Google Translate window. It seems that is somewhat harder, especially because the text you select might be broken up in several pieces, like:


This might be <b>your text</b>, so how do you   replace it?

Here it is: ubiquity.js

Ubuntu 8.04 and Perl OpenGL extension

Recently, I was trying to install the perl OpenGL module for a fun hack I'm trying to write at home.

There was no way of getting it installed. The compilation didn't succeed. The error message from the compiler was something along the line of:


... /usr/lib/xorg/extensions/glx.so: Undefined symbol GetTimeInMillis ...

Searching on the web held the following result (just 1):

Perl and OpenGL: http://ubuntuforums.org/showthread.php?t=948812

Reading the thread, from last October, it was clear that the author found no solution to this problem. A look at the OpenGL extension, and in particular, to its build script revealed that you can compile and link the OpenGL extension with different GL libraries.

Turns out that Ubuntu works with the FREEGLUT library. Thus, doing:

$ wget http://cpan.perl.org/modules/by-module/OpenGL/OpenGL-0.57.tar.gz
$ tar xzvf OpenGL-0.57.tar.gz
$ cd OpenGL-0.57
$ perl Makefile.PL interface=FREEGLUT
$ make
$ make test
(a small demo application should run...)
$ sudo make install

should build and install the OpenGL extension.
More about my fun project later… It's going to be presented at the Nordic Perl Workshop next April…