You are not logged in.

#1 2008-08-27 16:29:03

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Mozilla just released a cool plugin for interacting with the Internet with a CLI in Firefox - check it out here: http://labs.mozilla.com/2008/08/introducing-ubiquity/ . It's an offshoot of Aza Raskin's work with Enso.

I've created these scripts for searching the Arch Wiki, Arch BBS, and AUR Packages:

makeSearchCommand({
  name: "archwiki",
  url: "http://wiki.archlinux.org/index.php/Special:Search?search={QUERY}&go=Go",
  icon: "http://wiki.archlinux.org/favicon.ico",
  description: "Searches the Arch Wiki."
});

makeSearchCommand({
  name: "archbbs",
  url: "http://bbs.archlinux.org/search.php?action=search&keywords={QUERY}&author=&forum=-1&search_in=all&sort_by=0&sort_dir=DESC&show_as=topics&search=Submit",
  icon: "http://wiki.archlinux.org/favicon.ico",
  description: "Search the Arch Forums."
});

makeSearchCommand({
  name: "aur-packages",
  url: "http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K={QUERY}&SeB=nd&SB=n&SO=a&PP=25&do_Search=Go",
  icon: "http://wiki.archlinux.org/favicon.ico",
  description: "Search the AUR for Packages."
});

To use them, install the plugin, and then open the command editor (in Ubiquity, type "command-editor" and hit enter). Then paste the above code in to the command editor. To search, hit your Ubiquity key (I set mine to Ctrl-Space), then type "archwiki foo", or whatever.

I'd love to see how people can improve on these! There's a way to have previews as you type, but I think it requires a preview API from the search engine, which I doubt the Arch sites have.

Offline

#2 2008-08-27 19:07:28

dsr
Member
Registered: 2008-05-31
Posts: 187

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

That's pretty cool. How does it differ from Firefox's keyword searches? I have Firefox set up so that I can type in the URL bar (well actually in Vimperator's command-line) "arch [terms]" to search the Arch wiki, "pacman [terms]" to search [core] and [extra], "aur [terms]" to search [unsupported] and [community], and "bbs [terms]" to search the forum.

Offline

#3 2008-08-27 19:10:41

panzer
Member
Registered: 2006-08-28
Posts: 15

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

That is awesome. Installed it and added your commands. Thanks, man!

Offline

#4 2008-08-27 19:37:18

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

I already have Opera set up to search the Arch wiki when I type "a what to search for", but I didn't think of an AUR one. Little shortcuts like this are really very useful, as it's faster than going to the actual page and searching through there smile

Offline

#5 2008-08-27 22:10:06

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

dsr:

How does it differ from Firefox's keyword searches?

I've never heard of keyword searches, that looks pretty cool! Search is about the most boring thing Ubiquity does, so I guess if you're going to use it for the cool stuff, you might as well use it for boring searches as well smile. I guess one small advantage is that you don't have to type out "arch" or "pacman" - with my setup, it figures out I'm going for "aur-search" after I've just typed "au".

BTW, please excuse the misspelled title, I spend too much time working with HD Radio (www.ibiquity.com) . . .

Offline

#6 2008-08-28 01:26:53

Pnevma
Member
Registered: 2008-04-11
Posts: 112

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Wow, ubiquity is seriously awesome.

Offline

#7 2008-08-28 04:40:28

loyx
Member
Registered: 2008-06-11
Posts: 15

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

didn't bother setting it up yet, but i'm almost definitely sure vimperator does this

vimperator ftw smile

Offline

#8 2008-08-28 12:39:58

ido
Member
Registered: 2007-09-15
Posts: 28

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Yes, vimperator can do it too, I use it smile

Offline

#9 2008-08-28 14:52:32

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

To all the vimperator fans, I still think Ubiquity is still worth checking out, it really does a lot more than the simple search scripts I threw together. For example:

Type "we (zip code)", and it will automatically bring up a preview of current weather conditions as you type. Hit enter, and it opens a new tab with the full forecast from wunderground.com

Type "email this to (gmail contact name)", and it will send your current page (or selected text) to the contact name - they're going to add support for other email clients as well.

Select some text on a page, then type "trans this to sp", and the selected text will change to spanish instantly, without reloading the page

Type "map (place)" and it will open up a google map of the location.

It's really not comparable to vimperator, each tool is designed for different purposes, despite some overlaps. vimperator is designed to navigate the browser with the simplicity of vi commands (which I love as vi fan), and Ubiquity is designed to simplify access to various internet based services

Offline

#10 2008-08-28 15:16:23

filou.linux
Member
From: Zurich
Registered: 2008-04-17
Posts: 87

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

I've been using ubiquity for two days now (quiet a long time, I know). Its a great tool. Im really looking forward to what that tool can emerge. However theres one thing I cant get used to: Auto-completion with tab doesnt work sad that would be  very handy if you have to add some params to the command. Has someone an idea why it behaves that way? thanks in advance.

@deadrabbit: really like your commands, thanks for your effort smile

Offline

#11 2008-08-28 22:50:29

voteforpedro36
Member
Registered: 2008-08-06
Posts: 99

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Wait, ubiquity? Is that not the name of Ubuntu's installer, or am I going crazy?

Offline

#12 2008-09-03 09:40:08

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

voteforpedro36 wrote:

Wait, ubiquity? Is that not the name of Ubuntu's installer, or am I going crazy?

that was the first comment made on slashdot :
http://tech.slashdot.org/article.pl?sid … 27/1843222


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#13 2008-09-04 17:01:52

crouse
Arch Linux f@h Team Member
From: Iowa - USA
Registered: 2006-08-19
Posts: 903
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

I HAD to try this smile  It is pretty cool, would help if I knew alot more javascript I think.
I did write 2 very simple ones just to see if I could.

CmdUtils.CreateCommand({
  name: "vi",
  icon: "http://www.usalug.org/favicon.ico",
  preview: "The VI tutorial on usalug.org",
  execute: function() {
    openUrl( "http://usalug.org/vi.html" );
  }
})

CmdUtils.CreateCommand({
  name: "archmail",
  icon: "http://bbs.archlinux.org/favicon.ico",
  preview: "Archlinux.us email",
  execute: function() {
    openUrl( "https://www.google.com/a/archlinux.us/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fa%2Farchlinux.us&ltmpl=default&ltmplcache=2" );
  }
})

Offline

#14 2008-09-10 15:13:00

filou.linux
Member
From: Zurich
Registered: 2008-04-17
Posts: 87

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

It's been a little while now since it came out. I'm asking myself rightnow: Are people using ubiquity in their daily life?

Speaking for myself: I do! Not all the time, but quiet often. Especially, searching the AUR with ubiquity and deadrabbit's scripts became even easier! I love it! The feature that I still miss is the lack of the Tab-completion! Has nobody an Idea on that?

Exitedly expacting your answers. Cheers.

Offline

#15 2008-09-11 02:39:15

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

It's been a little while now since it came out. I'm asking myself rightnow: Are people using ubiquity in their daily life?

Perhaps not surprisingly, since I was excited enough to start this thread, I'm using it all the time. In addition to Arch bbs and wiki searches, I use the google search, wikipedia, maps, and weather the most. I also wrote scripts for searching my company's intranet and documentation sites, which I use quite a bit. I went a bit crazy writing scripts - I wrote them for whois searches, man pages search, etymology, Newegg, and local food and entertainment searches.

Offline

#16 2008-10-06 12:18:13

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

I have just discovered this, it's an amazing extension!
Do you know if there is any way to change the fonts it uses? On my system they are a ugly roman type.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#17 2008-10-06 12:27:07

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,170

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Stickying....

Offline

#18 2008-10-06 14:24:33

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Ok I found it :>

Go into:

~/.mozilla/firefox/YOURPROFILE/extensions/ubiquity@labs.mozilla.com/chrome/content/preview.css

and add:

font-family: helvetica, arial, sans-serif;
font-size: small;

to the body declaration (of course you can choose different fonts). big_smile

Source: http://getsatisfaction.com/mozilla/topi … quity_font


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#19 2008-11-05 13:47:02

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

My Arch search scripts do no work in Ubiquity 0.1.2 - I haven't had a chance to figure out how to rewrite them for the new version yet.

Offline

#20 2008-11-05 15:11:44

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,751

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

CmdUtils.CreateCommand({
    name: "awiki",
    contributors: ["Mr Green"],
    license: "MPL",

    description: "Search all of archlinux wiki",
    help:  "Enter a string to search at archlinux wiki",

    takes:  {"Search string":  noun_arb_text},
    preview:  "Search all of archlinux wiki.",
    execute: function( search_string ) {
        var prefix_url = "http://wiki.archlinux.org/index.php/Special:Search?search=";

        var search_url = prefix_url + search_string.text;

        Utils.openUrlInBrowser(search_url);
    }
})

Does that help.... still not sure myself... ok so I forgot icon hehe

Last edited by Mr Green (2008-11-05 15:15:29)


Mr Green

Offline

#21 2008-11-05 23:04:00

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Thank you Mr Green! Here's the updated code for version 0.1.2, based on your work:

CmdUtils.CreateCommand({
    name: "awiki",
    contributors: ["Mr Green", "deadrabbit"],
    license: "MPL",

    description: "Search all of archlinux wiki",
    help:  "Enter a string to search at archlinux wiki",

    takes:  {"Search string":  noun_arb_text},
    preview:  "Search all of archlinux wiki.",
    icon: "http://wiki.archlinux.org/favicon.ico",
    execute: function( search_string ) {
        var prefix_url = "http://wiki.archlinux.org/index.php/Special:Search?search=";
        var search_url = prefix_url + search_string.text;
        Utils.openUrlInBrowser(search_url);
    }
})
  
CmdUtils.CreateCommand({
    name: "bbs-arch",
    contributors: ["Mr Green", "deadrabbit"],
    license: "MPL",

    description: "Search all of archlinux forums",
    help:  "Enter a string to search the archlinux forums",

    takes:  {"Search string":  noun_arb_text},
    preview:  "Search the archlinux forums.",
    icon: "http://wiki.archlinux.org/favicon.ico", 
    execute: function( search_string ) {
        var prefix_url = "http://bbs.archlinux.org/search.php?action=search&keywords=";
        var after_crap_url = "&author=&forum=-1&search_in=all&sort_by=0&sort_dir=DESC&show_as=topics&search=Submit"
        var search_url = prefix_url + search_string.text + after_crap_url;
        Utils.openUrlInBrowser(search_url);
    }
})

CmdUtils.CreateCommand({
    name: "aur-packages",
    contributors: ["Mr Green", "deadrabbit"],
    license: "MPL",

    description: "Search the AUR for Packages.",
    help:  "Enter a string to search the AUR",

    takes:  {"Search string":  noun_arb_text},
    preview:  "Search the AUR for Packages.",
    icon: "http://wiki.archlinux.org/favicon.ico", 
    execute: function( search_string ) {
        var prefix_url = "http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=";
        var after_crap_url = "&SeB=nd&SB=n&SO=a&PP=25&do_Search=Go"
        var search_url = prefix_url + search_string.text + after_crap_url;
        Utils.openUrlInBrowser(search_url);
    }
})

And some generally linux-y stuff: whois and man page searches:

CmdUtils.CreateCommand({
  name: "man",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  
  description: "Search man pages",
  help:  "Enter a string to search the man pages",
  
  takes:  {"Search string":  noun_arb_text},
  preview:  "Search the man pages",
  execute: function( search_string ) {
  var prefix_url = "http://www.linuxmanpages.com/man1/";
var after_crap_url = ".1.php"
    var search_url = prefix_url + search_string.text + after_crap_url;
Utils.openUrlInBrowser(search_url);
}
})
  
CmdUtils.CreateCommand({
  name: "whois",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  
  description: "whois domain lookup",
  help:  "Enter a domain to query.",
  
  takes:  {"Search string":  noun_arb_text},
  preview:  "Enter a domain to query.",
  execute: function( search_string ) {
  var prefix_url = "http://reports.internic.net/cgi/whois?whois_nic=";
var after_crap_url = "&type=domain"
    var search_url = prefix_url + search_string.text + after_crap_url;
Utils.openUrlInBrowser(search_url);
}
})

Offline

#22 2008-11-06 06:19:58

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,751

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

It may be a good idea to either start a wiki page ..... or pastebin this stuff

The possibilities are endless :-)

MrG


Mr Green

Offline

#23 2008-11-18 00:02:53

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,418
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Modified deadrabbit's code to search the bugtracker... right now it searches all projects, but could easily be modified to search specific sections.

CmdUtils.CreateCommand({
  name: "arch-bugs",
  contributors: ["Ghost1227", "Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search the Arch Bugtracker.",
  help: "Enter a string to search the Arch Bugtracker.",
  takes: {"Search string": noun_arb_text},
  preview: "Search the Arch Bugtracker.",
  icon: "http://bugs.archlinux.org/themes/Archer/favicon.ico",
  execute: function( search_string ) {
    var prefix_url = "http://bugs.archlinux.org/index.php?string=";
    var search_url = prefix_url + search_string.text;
    Utils.openUrlInBrowser(search_url);
  }
})

Offline

#24 2008-11-18 00:12:50

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,418
Website

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

And here's a start of a wiki page for Ubiquity commands.

If anyone has requests for scripts, please let me know... I'm having fun with this now tongue

Last edited by Ghost1227 (2008-11-18 05:04:48)

Offline

#25 2008-11-19 14:03:48

deadrabbit
Member
Registered: 2008-04-26
Posts: 118

Re: Mozilla Ubiquity Scripts for Searching Arch Wiki, BBS, AUR

Nice work Ghost1227!

The ideal way to distribute these scripts would be in external js files, which can be subscribed to in Ubiquity. If you visit a page with

<link rel="commands" href="ubiquitycommandfile.js" />

in the head, Firefox recognizes it as an Ubiquity feed, and asks if you'd like to subscribe to it. That way, updates to the scripts are automatic.

I don't have a place to host those myself, perhaps there's a place for this sort of thing on the Arch site.

In any case, the wiki page is a huge improvement, and I suppose copying and pasting commands is more secure than trusting an automatic feed of updates.

Offline

Board footer

Powered by FluxBB