|
Script Summary:
Show the favorite items (e.g. Wikipedia entries) at the top of the Google search result. Version: 1.2 |
This script has no discussions. |
this script has 2 reviews |
||||||||||||||||||
This script makes your favorite items shown at the top of the Google search result page. For example, pretend you are a fan of Wikipedia. When you search "Gmail" in Google, the "Gmail - Wikipedia, the free encyclopedia" entry will be the first result instead of the official Gmail website.
Optionally, the script can automatically promotes the favorite items with the undocumented Google SearchWiki API so that you can see the same effect without installing Greasemonkey in other computers (must login to the same Google account). This feature works even you have disabled SearchWiki in the preferences.
By default, this script promotes every Wikipedia items (any language) in the Google result page. You can change the title_regexp and/or addr_regexp options to priorize any items with your own specific pattern.
The SearchWiki functionality uses Firefox native JSON object, which is introduced in Firefox 3.5, to speed up marking process noticeably. Please use Firefox 3.5 and later versions.
Note: if you use any script that changes the order of items in the search result page such as GoogleKingKong or GoogleMonkeyR, make sure Favorite items first in Google is listed above these scripts in the Greasemonkey script manager.
Options
Below are the customizable options:
- title_regexp: Javascript regular expression to match the pattern of promoted item titles. By default matches English Wikipedia items. (default /^.+- Wikipedia, the free encyclopedia$/)
- addr_regexp: Javascript regular expression to match the pattern of promoted entry link addresses. By default matches any Wikipedia items. (default /^\w+\.wikipedia\.org\/.*$/)
- match_pattern: integer switch of how to use the two regular expressions mentioned above. See the next section for description. (default 3)
- searchwiki_promote: promote the Wikipedia entries with Google SearchWiki. (default disabled)
- mark_promoted: use special background color to mark promoted entries. (default enabled)
- req_interval: XML HTTP request interval. (default 500ms)
Please open the script file to change the options.
match_pattern usage
match_pattern is an integer interpreted in 3 bits. The least significant bit (bit 1) indicates whether or not use the title_regexp variable to match an item. Bit 2 indicates whether or not use the addr_regexp variable. Bit 3 equals to 0 if use OR to connect the two relations, and equals to 1 if use AND. The following table enumerates all 8 possibilities:| match_pattern value | Description |
| 0 | No item will be matched |
| 1 | Item matches if title_regexp matches |
| 2 | Item matches if addr_regexp matches |
| 3 | Item matches if title_regexp matches OR addr_regexp matches |
| 4 | Every item will be matched |
| 5 | Item matches if title_regexp matches |
| 6 | Item matches if addr_regexp matches |
| 7 | Item matches if title_regexp matches AND addr_regexp matches |
By default, this script uses value 3.
Preview

Version history
1.2 on 11/08/2009:
- add feature to select items by both title and/or link address.
1.1.1 on 08/14/2009:
- Fix bug: when the original top two or more results are Wikipedia entries, their order flips.
1.1 on 08/13/2009:
- Move entries to the top immediately.
- Promote all Wikipedia entries in the first page.
- Use special background color to mark promoted entries.
1.0 on 08/13/2009:
- Initial version.





