Page 1 of 1

Search PureBasic Forum

Posted: Sat Jan 21, 2012 6:07 am
by Randy Walker
(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''

Re: Search PureBasic Forum

Posted: Sat Jan 21, 2012 6:40 am
by skywalk

Re: Search PureBasic Forum

Posted: Sun Jan 22, 2012 2:33 pm
by kvitaliy
A simple search on the main forum PureBasic:

Code: Select all

;{ 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)
   
      FrameGadget(#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%2Fpurebasic.info%2FphpBB3ex";http://purebasic.info/phpBB3ex/
           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$="+"+Chr(34)+URLEncoder(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://purebasic.info/phpBB3ex/")
           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
;
;}


Re: Search PureBasic Forum

Posted: Sun Jan 22, 2012 5:17 pm
by Rings
Randy Walker wrote:(Should this be a sticky somewhere?)
done, and also splitted topic into
http://www.purebasic.fr/english/viewtop ... 17&t=48957
thx

Re: Search PureBasic Forum

Posted: Mon Jan 23, 2012 7:01 pm
by c4s
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 ;))

Re: Search PureBasic Forum

Posted: Wed Feb 01, 2012 3:35 pm
by Zebuddi123
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)

:)

Re: Search PureBasic Forum

Posted: Thu Feb 02, 2012 5:23 am
by kvitaliy
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!

Re: Search PureBasic Forum

Posted: Thu Feb 02, 2012 12:53 pm
by Zebuddi123
@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

Re: Search PureBasic Forum

Posted: Fri May 17, 2013 7:59 am
by Joris
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.

Re: Search PureBasic Forum

Posted: Mon Jul 01, 2013 9:09 pm
by utopiomania
Google using searches like this: bitblit site:purebasic.com.. :)

Re: Search PureBasic Forum

Posted: Mon Jul 15, 2013 3:44 pm
by blueznl
Doin' that for ages in CodeCaddy...

Re: Search PureBasic Forum

Posted: Tue Aug 09, 2016 9:19 am
by tj1010
I use this sometimes. It's basically reductive search used to find un-fixed PB bugs. I used Delay() and top-level pagination to avoid stressing the server on top of not parsing and requesting anything.

Code: Select all

;Un-fixed bugs reported on PB forums finder thing
EnableExplicit
InitNetwork()
Dim fmz.s(3,1)
fmz(0,0)="4"
fmz(0,1)="Windows Bugs"
fmz(1,0)="23"
fmz(1,1)="Linux Bugs"
fmz(2,0)="24"
fmz(2,1)="OSX Bugs"
fmz(3,0)="37"
fmz(3,1)="Doc Bugs"
Define look.l=30,i.l=0,ii.l=0,*buffer,html$,posts.l
Declare unsolved(html$)

Debug "<html><header></header><body style="+Chr(34)+"background-color:#000;color:#0f0;"+Chr(34)+">"
For i = 0 To ArraySize(fmz())
  Debug "<h1>"+fmz(i,1)+"</h1>"
  *buffer=ReceiveHTTPMemory("http://www.purebasic.fr/english/viewforum.php?f="+fmz(i,0))
  If *buffer
    html$=PeekS(*buffer,MemorySize(*buffer),#PB_UTF8)
    FreeMemory(*buffer)
    unsolved(html$)
    ;get thread count
    For ii=3000 To 0 Step -1
      If CountString(html$,"&start="+Str(ii))>0
        posts=ii+30
        Break
      EndIf
    Next
    ;paginate
    Repeat
      *buffer=ReceiveHTTPMemory("http://www.purebasic.fr/english/viewforum.php?f="+fmz(i,0)+"&start="+Str(look))
      If *buffer
        html$=PeekS(*buffer,MemorySize(*buffer),#PB_UTF8)
        FreeMemory(*buffer)
        unsolved(html$)
      Else
        Break
      EndIf
      look=look+30
      If look>posts : Break : EndIf
      Delay(Random(15000,5000))
    ForEver
    look=30 : posts=0
  EndIf
Next
Debug "</body></html>"
End

Procedure unsolved(html$)
  Protected title.s
  Protected url.s
  Protected pos.l
  Repeat
    pos=FindString(html$,"topictitle",pos+1)
    If Not pos : Break : EndIf
    title=Mid(html$,pos+12,FindString(html$,"<",pos+12)-(pos+12))
    url=Mid(html$,FindString(html$,"href="+Chr(34),pos-100)+6,FindString(html$,Chr(34),(FindString(html$,"href="+Chr(34),pos-100)+6))-(FindString(html$,"href="+Chr(34),pos-100)+6))
    url=ReplaceString(url,"&","&")
    url=ReplaceString(url,"./","http://www.purebasic.fr/english/")
    If CountString(url,"&sid=")>0 : url=ReplaceString(url,Mid(url,FindString(url,"&sid="),37),"") : EndIf
    If CountString(title,"Done")=0 And CountString(title,"done")=0
      Debug "<a href="+Chr(34)+url+Chr(34)+">"+title+"</a><br>"
    EndIf
    title="" : url=""
  ForEver
EndProcedure
I wonder if stuff like this still works on Google:

Code: Select all

site:purebasic.fr inurl:/english/ ("assembly" | "push" | "jnz" | "_(") -inurl:f=12

Re: Search PureBasic Forum

Posted: Tue Aug 09, 2016 9:32 pm
by Keya
for PB searches i just google with "inurl:purebasic", which can also help find Russian and Chinese and other non-purebasic.com English contributions (and also searches purebasic.fr though im not sure if that makes a difference to purebasic.com). Agree that phpBB's search is almost useless, which took me all of 1 week as a PB newbie to realise lol, but is good for searching specifically for a couple things like authors, or specifically searching topics instead of message bodies.

Another thing i find handy to exploit is PB's unique "_" suffix on API's which can make googling for PB-specific API-specific code easy. For example, just do a search for "FindWindow_" and the top results are all Purebasic, even without adding "inurl:purebasic" or anything, and despite google being drowned in various source codes from all languages calling that not-uncommon API