Post Reply 
Scroogle search URL filter
Jun. 04, 2006, 09:18 AM
Post: #1
Scroogle search URL filter
I tried to write a search filter to jump to Scroogle to find something, but it does not work quite as I expected. It is based on the Google search filter which came with Prox. If I type only one word into the address bar in Firefox, the filter works as expected and jumps the browser to Scroogle. If I type more than one word, Firefox goes to Google instead. I was wondering why this is happening. I already made a successful Scroogle search plugin (by converting a Google plugin), so it is no big deal if it cannot be fixed, but I am curious!
Code:
[HTTP headers]
In = FALSE
Out = FALSE
Key = "URL: Enable Scroogle search (out)"
URL = "[^./]+/(^?)&\w[a-z]&$JUMP(http://www.scroogle.org/cgi-bin/nbbw.cgi/search?q=\h)"

In = FALSE
Out = TRUE
Key = "URL: Enable Google search (out)"
URL = "[^./]+/(^?)&\w[a-z]&$JUMP(http://www.google.ca/search?q=\h)"
I included both filters to show the base from which I started.
Add Thank You Quote this message in a reply
Jun. 04, 2006, 05:57 PM
Post: #2
RE: Scroogle search URL filter
Siamesecat;

I modified your filter in two ways. First, the query string was simply "h", and it needed a backslash to make it use the matching portion of the string. (See Proxo's Help/MatchingCharacterReference page, if this doesn't make sense). Second, in order to relieve the user of having to remember to use quotes to surround multiple search parameters, I added them into the query string, like so:

URL = "[^./]+/(^?)&\w[a-z]&$JUMP(http://www.scroogle.org/cgi-bin/nbbw.cgi/search?q=\\"\h\")"

But you know, I can't help but feel that this whole thing is more or less "re-inventing the wheel". You do realize that Scott included a filter in the default set that does this very thing, don't you? All you need to do is preface your query string with a period, and Presto!, you're home free. Don't like Google? (And it's obvious you want to change to Scroogle here.Whistling) Just edit the "catch-all" entry in the URL Alias list, it should be the last line in the file.

Just a thought, that's all.Cool


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jun. 04, 2006, 07:55 PM
Post: #3
RE: Scroogle search URL filter
Oddysey,
What happened to my backslash? It was there to start with, in both filters.
Why escape the quotes? It should not be necessary.
I was using Scott's filter for Google, but the backslash got removed from the \h when the code was posted. That filter looks for a string without a period or a slash before it will kick in. I'll try your modification and see what happens... I just tried it. It still does not work with or without backslashes in front of the quotes.
I tried the Alias list approach, which does not work with Scroogle either (perhaps because it is a cgi search?). I still need Google to get a cached version of a page that is no longer online, so I'll just keep the Google search filter, and use the search plugin for Scroogle.
Add Thank You Quote this message in a reply
Jun. 05, 2006, 01:27 AM (This post was last modified: Jun. 05, 2006 01:34 AM by JJoe.)
Post: #4
RE: Scroogle search URL filter
Siamesecat Wrote:If I type more than one word, Firefox goes to Google instead. I was wondering why this is happening.
I'd guess Firefox is doing it. 2 words or an invalid address probably trigger the 'search from url bar' feature and cause Firefox to send the words to Google.

Other Browser features can also mess this up. 'URL auto complete' modifies the string. Some Browsers won't allow things like "siamese+cat/".

You might be able to replace the space with "-" and modify the filter to ...
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "URL: Enable Keyword search II (Out)"
URL = "[^./]+/(^?)&(\#-$SET(#=\+))+\#/&$JUMP(http://www.google.com/search?q=\\@)"
Seems to work here. Entering "siamese-cat/" gets me http://www.google.com/search?q=siamese+cat

Siamesecat Wrote:What happened to my backslash?
Looks like you need to use \\ to get a \ in a URL. That's not good.

HTH
Add Thank You Quote this message in a reply
Jun. 05, 2006, 07:29 AM
Post: #5
RE: Scroogle search URL filter
Quote:Key = "URL: Enable Keyword search II (Out)"
URL = "[^./]+/(^?)&(\#-$SET(#=\+))+\#/&$JUMP(http://www.google.com/search?q=\@)"
The Google filter from Scott's default.cfg works. I had no problem with that. I was trying to jump to Scroogle to search the same way. That worked only if I typed just one word. Scroogle search does not seem to work the same way. You have to specify the cgi page.
This is a line from my Scroogle search plugin:
action="http://www.scroogle.org/cgi-bin/nbbw.cgi/search"
Quote:Looks like you need to use \\ to get a \ in a URL.
Why would code be altered? It was within code markers.
Add Thank You Quote this message in a reply
Jun. 05, 2006, 02:02 PM
Post: #6
RE: Scroogle search URL filter
Siamesecat Wrote:I was trying to jump to Scroogle to search the same way. That worked only if I typed just one word.
Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "URL: Enable Scroogle search (out)"
URL = "[^./]+/(^?)&(\#-$SET(#=\+))+\#/&$JUMP(http://www.scroogle.org/cgi-bin/nbbw.cgi/search?q=\\@)"
Works for me. Use "-" for spaces. "siamese-cat/" to search scroogle for "siamese cat".

Siamesecat Wrote:
Quote:Looks like you need to use \\ to get a \ in a URL.
Why would code be altered? It was within code markers.
Good question. Wink

HTH
Add Thank You Quote this message in a reply
Jun. 06, 2006, 06:27 AM
Post: #7
RE: Scroogle search URL filter
JJoe,
It works! Thanks a bunch. Now all I have to do is get into the habit of putting hyphens between my search words.
Add Thank You Quote this message in a reply
Jun. 09, 2006, 07:44 PM
Post: #8
RE: Scroogle search URL filter
Siamesecat;

The reason the slash disappeared is due to a fault within the MyBB software itself. Even if you use the quote or code tags, you need to prepend another slash in order to make the desired slash show up. (Just like you would do in a Proxo filter.) However, using the php tag will display a single slash correctly, no additional one needed. Unfortunately, this tag makes most of the remaining text Ugly, with a capital U.Sad

I escaped the quote marks out of habit. It seems that about half the time a filter doesn't work for me, it's usually due to my forgetting to escape something. While it's extra typing if the slashes aren't needed, I've just gotten into the habit, that's all. Wink

I find it interesting that I can type the Scroogle script address into the address bar, with one or more parameters, and the search will work. But, if I try to do that from a filter, the search breaks. I have no idea why that is. But as an aside, I do note that when I send a query, the address bar reflects %20 wherever there was a space. Hmmmm, I wonder what would happen if I make Proxo insert that figure instead of spaces.......

I am under the impression that Fox's plugins can be made by users, is that so? Then, can't a plugin be reverse engineered by another user? Can you dig into your particular Scroogle plugin, and see what's going on that makes it work? It'd be nice to know. >:]


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jun. 10, 2006, 08:38 AM
Post: #9
RE: Scroogle search URL filter
Oddysey,
Quote:I am under the impression that Fox's plugins can be made by users, is that
so? Then, can't a plugin be reverse engineered by another user? Can you dig
into your particular Scroogle plugin, and see what's going on that makes it work?
It'd be nice to know.
The search plugins and the other plugins are very different from each other. The
search plugins are text files with extension .src, and a small image to be used as
an icon goes with each one. These images are either .gif files or .png files. I
used a Google search plugin text file to begin with, removed some lines, changed
the URL and saved the file under a new name. I made the icon by doing a screen
capture from the start page of Scroogle and then pasting it into Irfanview,
trimming it to leave only the "S", resizing to 16X16, and saving as a .gif.
Here is my Scroogle plugin (saved as scroogle.src):

Quote:# Mozilla/Scroogle plugin

<search
name="Scroogle"
description="Scroogle Search"
method="GET"
action="http://www.scroogle.org/cgi-bin/nbbw.cgi/search"
queryEncoding="utf-8"
queryCharset="utf-8"
>

<input name="q" user>

<interpret
browserResultType="result"
charset = "UTF-8"
>
</search>
Incidentally, Scroogle uses "POST" on its page, not "GET", however the plugin did
not work with "POST".
Add Thank You Quote this message in a reply
Jun. 12, 2006, 08:30 PM
Post: #10
RE: Scroogle search URL filter
Siamesecat;

Well, there ya go. Wink

The difference between a POST and a GET is that the GET directive places all the form variables into a new address, separating them with ampersands, and sends that as a request to a server. The message is essentially empty, the important data being on the address line. OTOH, a POST directive places the variables into a set of data within the message. The point is that each directive tells the receiving server where to look for the data.

However, there is nothing cast in stone about this process. If an author wants to violate these principles, he or she can do so with impugnity. This might explain why you can get Scroogle to work, but not in the way you'd expect from dissecting the code.

Personally? I'd stick with using Scott's default redirection filter, and typing in the occasional period. Seems like little effort, to me. So far, Scroogle hasn't shown me anything that a good set of filters can't already do. Whistling


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jun. 13, 2006, 06:28 AM
Post: #11
RE: Scroogle search URL filter
Oddysey,
Quote:Personally? I'd stick with using Scott's default redirection
filter, and typing in the occasional period. Seems like little effort,
to me. So far, Scroogle hasn't shown me anything that a good set of
filters can't already do.
With Scott's filter, if you include a period or a slash, the filter
will ignore the URL box contents, because URLs have periods, and often
slashes, in them. I am using Scott's filter for the URL bar with
Firefox and using the Scroogle search plugin. The Scroogle search
filter that JJoe made workable is set up to be used in IE (if I am ever
forced to browse with it).
Scroogle states that it sets no cookies (which I block from Google
anyway), keeps no search term records, and deletes its access log
within 48 hours. It also does not send your search terms out to the
destination site in the referrer (which I alter with a referer filter
anyway) because of its use of "POST".
I still have to use Google sometimes if I want to access more than 100
search results, because Scroogle only fetches one page full of results.
Scroogle also does not show cached pages or convert .doc or .pdf files
to .html. It also does not offer searching specifically for images.
Add Thank You Quote this message in a reply
Jun. 14, 2006, 04:10 PM
Post: #12
RE: Scroogle search URL filter
When I type one word into the firefox address bar with the filter activated that comes with proxo, it takes me to a google search. When I type more than one word with or without the filter activated, firefox redirects it to a google search page, but sets it to do the "I'm Feeling Lucky" thing and takes me to the first page that was on the google search.

I think the problem is with more than two search words, firefox takes over before your filter even has a chance.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Jun. 15, 2006, 06:18 AM
Post: #13
RE: Scroogle search URL filter
Shea,
You are right about Firefox taking over. I had changed the search code
in Firefox to use a normal search rather than the "I'm feeling lucky" search,
so I got a normal search. I just noticed that if I type in one word, I get
google.ca (the host name I put in the filter) whereas if I type in two or more
words, I get google.com, which is the Firefox default. I never noticed that before. If I put a hyphen between the words, I get google.ca.
Add Thank You Quote this message in a reply
Jun. 16, 2006, 06:32 AM
Post: #14
RE: Scroogle search URL filter
Siamesecat;

So is that hyphen behavior a Firefox thing? I don't get that in IE, I get the same google destination no matter what.


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Jun. 16, 2006, 10:30 AM
Post: #15
RE: Scroogle search URL filter
Oddysey,
I don't know about the hyphen thing, but IE does not have a default search
taking place from the address box if normal hostname structures are absent,
and Firefox does. What the hyphen does is get rid of spaces, so there is
only one string. Google search ignores hyphens.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: