Welcome Guest, Not a member yet? Register   Sign In
My Ubiquity script for searching the CI user guide
#1

[eluser]Natebot[/eluser]
I have written a Ubiquity script to aid in my CI development which I want to share with the community.

This script allows you to quickly search the CI user guide or to open a new tab to the table of contents.

If you have the Ubiquity Firebox add-on installed you can subscribe to my script at:
http://natebot.com/ubiquity/ubiquity-ci-search.php

edit: the behavior has changed a bit with a newer version. I added preview of search results.

Behavior:
1.type "ci-search" and your search keywords into the console, and you will be shown the top 4 search results from the user guide. Click any of them or hit enter and be shown all the search results.
2. highlight some text, open Ubiquity, and type "ci-search" and be shown 4 search results.
3. select some text, right click and choose Ubiquity>ci-search to go directly to the Google results.

I am willing to develop this further is people find it useful. Attached are two screen shots of the Ubiquity interface for those of you not acquainted with it.

enjoy!
#2

[eluser]xwero[/eluser]
I would love to see a preview of the search results instead of having to enter the search, going to the google search page and clicking on the link that is what i need.

I think the command is too limited for its name. ci search can mean looking in the user guide, forums and wiki so opening the user guide if no text is present is not useful. Maybe you should create a page where you can search all three site parts?

Any way it's a great contribution, thank you!
#3

[eluser]xwero[/eluser]
I did some more checking on the search boxes on the forum an wiki and i couldn't get a query string url to work, and i think because of the splash screen between the search and the results in the forum you will not able to get a preview of the results?
#4

[eluser]wiredesignz[/eluser]
Nice contribution Natebot, Good work man.
#5

[eluser]Natebot[/eluser]
I updated the script to provide previews of 4 results. Also included are two small links at the bottom of those results to search the wiki and forum with Google for the given keywords.

I think the wiki and forum searches probably require the POST method so it would require just a little bit of jQuery to get it to work right. I may add that in the future.

Thanks for the feedback.
#6

[eluser]GSV Sleeper Service[/eluser]
cool, I'd not heard of Ubiquity before, it's like Quicksilver in my browser, very nice indeed.
#7

[eluser]Natebot[/eluser]
[quote author="xwero" date="1231421951"] i think because of the splash screen between the search and the results in the forum you will not able to get a preview of the results?[/quote]

Yes I think so. Also it would take a bit of screenscraping fu to trim down the html into a format that fits in the console. The Google results are easy because it's JSON. Smile
#8

[eluser]xwero[/eluser]
The forum search results url is something like http://ellislab.com/forums/search_results/[id]. If the id is a hashing of key words then you can send a hash but i checked it with md5 and sha1 and that is not how the id is created. Maybe the hidden search form field XID salts the hash but i didn't check that yet.
#9

[eluser]GSV Sleeper Service[/eluser]
I've often wondered about the forum search hash. It could possibly be just a unique identifier for a result set, so you can bookmark your search. I've just tried the same search twice and got two different hashes.
#10

[eluser]xwero[/eluser]
Code:
// Codeigniter forum search
CmdUtils.CreateCommand({
  name: "cifs",
  description: "CodeIgniter forum search",
  takes: {"input": noun_arb_text},
  preview: function( pblock, input ) {pblock[removed]=this.description;},
  execute: function(input) {
    Utils.openUrlInBrowser('http://ellislab.com/forums/do_search/','XID=b30217bf7956064d2906f8c8af71140480373fe8&keywords;='+input.text);
  }
});
It works so the XID is the deciding factor whether a search is allowed or not.

As a bonus
Code:
// Codeigniter wiki search
CmdUtils.CreateCommand({
  name: "ciws",
  description: "Codeigniter wiki search",
  takes: {"input": noun_arb_text},
  preview: function( pblock, input ) {pblock[removed]=this.description;},
  execute: function(input) {
    Utils.openUrlInBrowser('http://codeigniter.com/wiki/Special:Search_results/','XID=b30217bf7956064d2906f8c8af71140480373fe8&keywords;='+input.text);
  }
});




Theme © iAndrew 2016 - Forum software by © MyBB