Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2005, 12:51 AM
KneeCo KneeCo is offline
Member
 
Join Date: Mar 2005
Location: Montreal
Posts: 77
Default Help me create a 2+2 Firefox Search Engine

Using the directions here I'm trying to create a plugin for Firefox to add a 2+2 search to the drop down search menu.

I have a problem with one line of the code, the "input name".

Here are the directions for that one line:
[ QUOTE ]
Next, you need to tell your plug-in what syntax to use when searching for the text you'll type into the Search Bar. This varies from site to site. Again, take a look at the URL that results after you search the site. Look for whatever falls between the first ampersand (&amp and your search term. For the www.whitehouse.gov site, it is qt.

Here's the syntax for this line:

<input name="query" user="">

So, in our instance, the line looks like this:

<input name="qt" user="">

[/ QUOTE ]

The problem is, there is no ampersand (&amp in the address when I perform a 2+2 search. Anyone know of a way around this?

Other than that, it works fine. I got it to show up in the menu with the lightbulb icon but whenever you search for something it just takes you to the search page, looks like this:



Here's the code I have so far (the problem line is in red):
[ QUOTE ]

<search
version="7.1"
name="2+2"
description="A Search Plugin for 2+2 Forums"
action="http://forumserver.twoplustwo.com/search.php"
searchForm="http://forumserver.twoplustwo.com"
method="GET"
>

<input name="sourceid" value="Mozilla-search">
<font color="red">&lt;input name="query" user=""&gt;</font>


&lt;/search&gt;


[/ QUOTE ]
Reply With Quote
  #2  
Old 11-03-2005, 05:02 AM
pokergrader pokergrader is offline
Senior Member
 
Join Date: Apr 2005
Posts: 210
Default Re: Help me create a 2+2 Firefox Search Engine

The search runs using dosearch.php with a POST, not a GET. Hence there is no &amp;

I'm not sure if it is possible to make a firefox search if it is a POST, but all the variables are between:

<font class="small">Code:</font><hr /><pre>&lt;form method="post" action="http://forumserver.twoplustwo.com/dosearch.php"&gt; </pre><hr />

and

<font class="small">Code:</font><hr /><pre>&lt;/form&gt;</pre><hr />

in search.php
Reply With Quote
  #3  
Old 11-03-2005, 09:21 AM
StevieG StevieG is offline
Senior Member
 
Join Date: Jan 2003
Location: Baltimore, MD, USA
Posts: 157
Default Re: Help me create a 2+2 Firefox Search Engine

[ QUOTE ]
The search runs using dosearch.php with a POST, not a GET. Hence there is no &amp;

I'm not sure if it is possible to make a firefox search if it is a POST

[/ QUOTE ]

That won't be necessary. PHP merges POST and GET variables (along with cookies and others) into one namespace for execution. The precedence is dependent on local PHP setup, but since KneeCo will only be sending the variable one way, that won't be a problem.

In other words, KneeCo, as long as you get the right variables in this request (pokergrader indicated where to find them in the form) you don't need to worry about variables not being shown in the URL and separated by an ampersand (&amp.

Good luck, let us know how it turns out.
Reply With Quote
  #4  
Old 11-03-2005, 01:38 PM
StevieG StevieG is offline
Senior Member
 
Join Date: Jan 2003
Location: Baltimore, MD, USA
Posts: 157
Default Re: Help me create a 2+2 Firefox Search Engine

[ QUOTE ]
Using the directions here I'm trying to create a plugin for Firefox to add a 2+2 search to the drop down search menu.

I have a problem with one line of the code, the "input name".

The problem is, there is no ampersand (&amp in the address when I perform a 2+2 search. Anyone know of a way around this?

Other than that, it works fine. I got it to show up in the menu with the lightbulb icon but whenever you search for something it just takes you to the search page

[/ QUOTE ]

Always cool to try this stuff out, so I thought I would do some more.

There are two basic reasons you are not getting search results: (1) you need to point to the search results page dosearch.php not the form page, search.php, and (2) you need to get the right input variables, especially for the user field.

So I took the liberty of doing that. The search plugin follows, with comments in blue:

<font class="small">Code:</font><hr /><pre>
<font color="blue"># 2+2 Forum Search Plugin for Firefox by KneeCo and StevieG</font>
<font color="blue"># comments start with the # sign</font>

<font color="blue"># The search tag specifies a name and description for our</font>
<font color="blue"># search plugin, and where to go on the Web to peform the</font>
<font color="blue"># actual search. We can find the input parameters for the </font>
<font color="blue"># search at http://forumserver.twoplustwo.com/search.php</font>
<font color="blue"># but the actual page that accepts those inputs and does</font>
<font color="blue"># the work is http://forumserver.twoplustwo.com/dosearch.php</font>
<font color="blue"># so we make that the action in the search tag.</font>
&lt;search
version="1.0"
name="2+2 Forum Search"
description="A Search Plugin for 2+2 Forums"
action="http://forumserver.twoplustwo.com/dosearch.php"
searchForm="http://forumserver.twoplustwo.com"
method="GET"
&gt;

<font color="blue"># Inside the search tag we specify the inputs for the </font>
<font color="blue"># search. These inputs were found by analyzing the search</font>
<font color="blue"># form at http://forumserver.twoplustwo.com/search.php</font>

<font color="blue"># This is the input for the actual search terms</font>
<font color="blue"># and is the only thing the user can enter from the </font>
<font color="blue"># plugin:</font>
&lt;input name=" Words" user=""&gt;

<font color="blue"># This input specifies which forum to search. </font>
<font color="blue"># Since the user can only input one thing (the search </font>
<font color="blue"># words) we will use a default of All Forums.</font>
&lt;input name="Forum[]" value="All_Forums"&gt;

<font color="blue"># This section includes the date range information</font>
<font color="blue"># the value listed here is to search for anything newer than</font>
<font color="blue"># 1 week. This can be changed by changing the value or</font>
<font color="blue"># type. Type can be d,w,m, or y for day, week, month, or year,</font>
<font color="blue"># respectively.</font>
&lt;input name="daterange" value="1"&gt;
&lt;input name="newerval" value="1"&gt;
&lt;input name="newertype" value="w"&gt;
<font color="blue"># If you want to stipulate a search for things older than</font>
<font color="blue"># a certain time, then uncomment and use the inputs below</font>
<font color="blue"># &lt;input name="olderval" value="3"&gt;</font>
<font color="blue"># &lt;input name="oldertype" value="d"&gt;</font>

<font color="blue"># Other inputs </font>
&lt;input name="fromsearch" value="1"&gt;
&lt;input name="checkwords" value="1"&gt;
&lt;input name="where" value="sub"&gt;

&lt;/search&gt;
</pre><hr />

You can save all that in your Program Files\Mozilla Firefox\searchplugins directory as twoplustwo.src to use it. Be sure to save as plain text, no markup for color. I would also grab this image and save it as twoplustwo.png to get an icon in the search pull down.

As people have pointed out, though, the 2+2 Forum search does suck, and many people use Google instead. So let's make a Google search for 2+2 specifically. To do this, I modified the existing google.src:

<font class="small">Code:</font><hr /><pre>
<font color="blue"># Mozilla/Google plug-in by amitp+mozilla@google.com</font>
<font color="blue"># Modified by StevieG for search by site</font>

&lt;search
name="2+2 through Google"
description="Google Search of Two Plus Two Forums"
method="GET"
action="http://www.google.com/search"
queryEncoding="utf-8"
queryCharset="utf-8"
&gt;

&lt;input name="q" user&gt;
&lt;inputnext name="start" factor="10"&gt;
&lt;inputprev name="start" factor="10"&gt;
&lt;input name="ie" value="utf-8"&gt;
&lt;input name="oe" value="utf-8"&gt;

<font color="blue"># this extra input does search by site</font>
<font color="red">&lt;input name="as_sitesearch" value="forumserver.twoplustwo.com"&gt;</font>

&lt;interpret
browserResultType="result"
charset = "UTF-8"
resultListStart="&lt;!--a--&gt;"
resultListEnd="&lt;!--z--&gt;"
resultItemStart="&lt;!--m--&gt;"
resultItemEnd="&lt;!--n--&gt;"
&gt;
&lt;/search&gt;
</pre><hr />

Save this as google2p2.src in the Mozilla Firefox/searchplugins directory and save this image as google2p2.gif for a nice icon.
Reply With Quote
  #5  
Old 11-03-2005, 01:45 PM
sammy_g sammy_g is offline
Junior Member
 
Join Date: Apr 2004
Posts: 0
Default Re: Help me create a 2+2 Firefox Search Engine

Nice. I haven't been able to try this yet since I'm at home, but if you wanted to create one for the 2+2 archives, you should be able to copy twoplustwo.src and replace forumserver.twoplustwo.com with archiveserver.twoplustwo.com, yeah?
Reply With Quote
  #6  
Old 11-03-2005, 02:02 PM
StevieG StevieG is offline
Senior Member
 
Join Date: Jan 2003
Location: Baltimore, MD, USA
Posts: 157
Default Re: Help me create a 2+2 Firefox Search Engine

[ QUOTE ]
Nice. I haven't been able to try this yet since I'm at home, but if you wanted to create one for the 2+2 archives, you should be able to copy twoplustwo.src and replace forumserver.twoplustwo.com with archiveserver.twoplustwo.com, yeah?

[/ QUOTE ]

Yeah, but the archiveserver search would require a change in date range. Ideally, you would be able to specify the start date for the archives in absolute terms, but the search form only takes relative terms. And the date range is limited to 6 months. So I suggest the following modification to the daterange area of the code in addition to changing the URLs:

<font class="small">Code:</font><hr /><pre>
&lt;input name="daterange" value="1"&gt;
&lt;input name="newerval" value="10"&gt;
&lt;input name="newertype" value="m"&gt;
&lt;input name="olderval" value="4"&gt;
&lt;input name="oldertype" value="m"&gt;
</pre><hr />
Reply With Quote
  #7  
Old 11-04-2005, 03:32 AM
splashpot splashpot is offline
Senior Member
 
Join Date: Nov 2004
Location: Needham, MA
Posts: 425
Default Re: Help me create a 2+2 Firefox Search Engine

This is really cool. Thanks a lot, dude. Just so I'm clear on how this works, the non-google one requires heavy use of + and " right? The google one works more like a normal search engine?
Reply With Quote
  #8  
Old 11-04-2005, 11:00 AM
StevieG StevieG is offline
Senior Member
 
Join Date: Jan 2003
Location: Baltimore, MD, USA
Posts: 157
Default Re: Help me create a 2+2 Firefox Search Engine

Using + and " will work for both. However, as you suggest, using those kinds of markers is probably more important for the non-Google forum search. By the way,the minus sign is often overlooked but it is also helpful, snce it can eliminate things you don't want. So if you want to search for mods but not for party you can do a search for +mod -party

Two other quick things:

KneeCo is submitting this to the mycroft search site, so it should soon be a snap to install this.

Here is an icon for the archivesearch
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.