It is currently Tue Jun 18, 2013 8:06 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Search PureBasic Forum
PostPosted: Sat Jan 21, 2012 6:07 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Jul 25, 2004 4:21 pm
Posts: 426
Location: US
(Should this be a sticky somewhere?)

PROBLEM:
The forum search feature can render some useless results when attemting to find terms it decides should be ignored. A simple example of this is the term EN_CHANGE. First thing the forum search will do is cast out the underscore and suddenly your single-word search term becomes two separate words (EN + CHANGE). Next it will cast out the ''EN'' because the word is considered to be too short. Placing the whole term in double quotes doesn't help because the forum search will cast out the quotes before it proceeds to disect and destroy the desired search term. Search results end up looking something like this:
    Search found 7653 matches
    Search term used: +change ignored: en

SOLUTION:
Very effective way to search any forum is to use google. You will need to isolate your search to show only the results from the PureBasic forum. You can do this with the special ''site:'' + ''domain" keyword.
For our purposes, using the example above, go to google and make the first search term (single-word, no-spaces) like this:
    site:forums.purebasic.com
Next, you need to type in a way that will tell google your search term is important AND you do not want it disected. The plus sign says this term is important and the quotes say do not disect, so the actual search term you are looking for would look something like this:
    +"EN_CHANGE"
Put it all together into the Google search box and it looks like this:
    site:forums.purebasic.com +"EN_CHANGE"
(Notice there is a space used here ^ after the .com and before the +''EN_CHANGE'')

Try to find ''in a way'' in the forum search and you get nothing, but not using Google. Try the following in Google for some interesting results:
    site:forums.purebasic.com +''in a way''
    site:forums.purebasic.com +''in a way'' +''in a way''
    site:forums.purebasic.com +''in a way'' +''in a way'' +''in a way''
    site:forums.purebasic.com +''in a way'' +''in a way'' +''in a way'' +''in a way''

_________________
- - - - - - - - - - - - - - - -
Randy
http://www.redrival.com/ethics IF (PureBasic > PowerBasic) AND (PowerBasic > Visual_Basic) THEN PureBasic > Visual_Basic


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Sat Jan 21, 2012 6:40 am 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 1410
Location: Boston, MA
http://www.purebasic.fr/english/viewtopic.php?p=363595#p363595

_________________
To understand recursion, you must first understand recursion. ~ unknown
I never make stupid mistakes. Only very, very clever ones. ~ John Peel


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Sun Jan 22, 2012 2:33 pm 
Offline
User
User

Joined: Mon May 10, 2010 4:02 pm
Posts: 51
A simple search on the main forum PureBasic:

Code:
;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
  #Frame3D_1
  #Text_2
  #Text_3
  #Text_4
  #Text_5
  #String_6
  #String_7
  #String_8
  #String_9
  #Container_10
  #Option_11
  #Option_12
  #Option_13
  #Option_14
  #Button_15
  #HyperLink_16
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu

;}
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 156, 142, 626, 346, "Search the forums for PureBasic (Google)", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
   
      Frame3DGadget(#Frame3D_1, 5, 15, 605, 155, "Setting")
      TextGadget(#Text_2, 10, 40, 140, 20, "with all of the words:")
      TextGadget(#Text_3, 10, 65, 135, 20, "with the exact phrase")
      TextGadget(#Text_4, 10, 91, 135, 20, "with any words")
      TextGadget(#Text_5, 10, 115, 135, 20, "NOT containing the words")
      StringGadget(#String_6, 160, 40, 420, 20, "")
      StringGadget(#String_7, 160, 65, 420, 20, "")
      StringGadget(#String_8, 160, 90, 420, 20, "")
      StringGadget(#String_9, 160, 115, 420, 20, "")
      ButtonGadget(#Button_15, 165, 270, 235, 25, "Start search")
      HyperLinkGadget(#HyperLink_16, 5, 320, 280, 20, "The most accurate search", #Blue, #PB_HyperLink_Underline)
      GadgetToolTip(#HyperLink_16, "The clipboard is selected forum")

      ContainerGadget(#Container_10, 10, 190, 600, 70)
        OptionGadget(#Option_11, 5, 5, 285, 15, "Russian Forum"):
        OptionGadget(#Option_12, 5, 25, 285, 15, "English Forum"):SetGadgetState(#Option_12,1)
        OptionGadget(#Option_13, 295, 5, 285, 15, "German Forum")
        OptionGadget(#Option_14, 295, 25, 285, 15, "French Forum")
      CloseGadgetList()
   
  EndIf
EndProcedure

OpenWindow_Window_0()

;{- Event loop
Repeat
  Event = WaitWindowEvent()
  Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
      EventGadget = EventGadget()
      EventType = EventType()
      If EventGadget = #Frame3D_1
      ElseIf EventGadget = #Button_15
        Inquiry$=""
        If GetGadgetState(#Option_11)
           Forum$="http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fpbasic.spb.ru%2FphpBB2"
           ElseIf  GetGadgetState(#Option_12)
           Forum$="http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Fenglish"
           ElseIf  GetGadgetState(#Option_13)
           Forum$="http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Fgerman"
           ElseIf  GetGadgetState(#Option_14)
           Forum$="http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Ffrench"
        EndIf
         
           
            If Len(GetGadgetText(#String_6))>2
                Inquiry1$="+"+URLEncoder(GetGadgetText(#String_6))
                Else
                Inquiry1$=""
            EndIf
            If Len(GetGadgetText(#String_7))>2
                Inquiry2$="+"+URLEncoder(Chr(34)+GetGadgetText(#String_7)+Chr(34))
                Else
                Inquiry2$=""
            EndIf
            If Len(GetGadgetText(#String_8))>2
             For i=1 To Len(GetGadgetText(#String_8))
                word$=StringField(GetGadgetText(#String_8), i, " ")
                If Len(word$)
                Inquiry3$=Inquiry3$+" | "+word$
                EndIf
             Next i
             Inquiry3$=URLEncoder(Inquiry3$)
            Else
                Inquiry3$=""
            EndIf
            If Len(GetGadgetText(#String_9))>2
            For i=1 To Len(GetGadgetText(#String_9))
                word$=StringField(GetGadgetText(#String_9), i, " ")
                If Len(word$)
                Inquiry4$=Inquiry4$+"+-"+word$
                EndIf
             Next i
             Inquiry4$=URLEncoder(Inquiry4$)
            Else
                Inquiry4$=""
            EndIf
            Inquiry$= Forum$+Inquiry1$+Inquiry2$+Inquiry3$+Inquiry4$
           
            RunProgram(Inquiry$)
       
             
      ElseIf EventGadget = #HyperLink_16
        If GetGadgetState(#Option_11)
           SetClipboardText("http://pbasic.spb.ru/phpBB2")
           ElseIf  GetGadgetState(#Option_12)
           SetClipboardText("http://www.purebasic.fr/english")
           ElseIf  GetGadgetState(#Option_13)
           SetClipboardText("http://www.purebasic.fr/german")
           ElseIf  GetGadgetState(#Option_14)
           SetClipboardText("http://www.purebasic.fr/french")
        EndIf
      RunProgram("http://www.google.com/advanced_search")
      EndIf
    ; ////////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver
;
;}


Last edited by kvitaliy on Thu Feb 02, 2012 5:22 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Sun Jan 22, 2012 5:17 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 26, 2003 1:11 am
Posts: 1311
Randy Walker wrote:
(Should this be a sticky somewhere?)

done, and also splitted topic into
viewtopic.php?f=17&t=48957
thx

_________________
SPAMINATOR NR.1


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Mon Jan 23, 2012 7:01 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1579
Location: Germany
I suggest to use "purebasic.fr" instead of "forums.purebasic.com" as the search url. The search engine of your choice will prefer results in your native language anyway and if you're searching for something really specific you might get helpful codes from the German and French forum as well! (hint: website translators ;))


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Wed Feb 01, 2012 3:35 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 275
Location: Nottinghamshire UK
Changed line 85 to

85 Inquiry2$="+"+URLEncoder(Chr(34)+GetGadgetText(#String_7)+Chr(34))

changed position of chr(34) for the " to be in the right place when searching with exact phrase
was

85 Inquiry2$="+"+Chr(34)+URLEncoder(GetGadgetText(#String_7))+Chr(34)

:)


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Thu Feb 02, 2012 5:23 am 
Offline
User
User

Joined: Mon May 10, 2010 4:02 pm
Posts: 51
Zebuddi123 wrote:
Changed line 85 to

85 Inquiry2$="+"+URLEncoder(Chr(34)+GetGadgetText(#String_7)+Chr(34))

changed position of chr(34) for the " to be in the right place when searching with exact phrase
was

85 Inquiry2$="+"+Chr(34)+URLEncoder(GetGadgetText(#String_7))+Chr(34)

:)

Ok!


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Thu Feb 02, 2012 12:53 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 275
Location: Nottinghamshire UK
@kvitaliy

Sorry was in a rush yesterday!!! thanks for the code its a great little program. using it all the time set as a tool in my pb ide

Thanks for sharing

Zebuddi


Top
 Profile  
 
 Post subject: Re: Search PureBasic Forum
PostPosted: Fri May 17, 2013 7:59 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 201
Location: BE
My 5 cents on Search PureBasic Forum :

I experience that much more results can be found with a Google Search like this "PureBasic bitblt", in this case if bitblt is what to look for.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye