A simple search web tool

Published on by Yousfi Benameur

*Serching in web is very important but some time waste too time.
*This is an utility tool to search in some specfic sites for a string
*Its a top level form with an autocomp textbox, a list of prefered sites (vfp) and a navigation *button.
*The defaut navigator searches through this tool and the site for your wanted string.
*Make this as main prg, add a config.fpw in a proj and compile to produce an exe(put it in *c:\windows\system32 to be accessed from anywhere.).A simple call (ysearch) and its here.

*Can add you prefered site in the comboBox in the code

*Note: please correct in code bracket tags due to provider  editor (>>)

*Begin Code

Publi yform
yform=Newobject("ysearch")
yform.Show
Read Events
Return

Define Class ysearch As Form
BorderStyle = 2
Height = 38
Width = 674
ShowWindow = 2
ShowTips=.T.
Caption = "Ysearch in the weblogs - Put the subject to search in combo site"
MaxButton = .F.
AlwaysOnTop = .T.
BackColor = Rgb(183,237,249)
Name = "Form1"

Add Object text1 As TextBox With ;
FontSize = 10, ;
Height = 33, ;
Left = 4, ;
Top = 3, ;
Width = 505, ;
selectOnEntry=.T.,;
AutoComplete = 3, ;
Name = "Text1"

Add Object command1 As CommandButton With ;
Top = 3, ;
Left = 634, ;
Height = 30, ;
Width = 37, ;
Caption = "Go", ;
MousePointer = 15, ;
backcolor=Rgb(0,255,0),;
Name = "Command1"

Add Object combo1 As ComboBox With ;
Height = 25, ;
Left = 516, ;
Top = 8, ;
Width = 108, ;
itemTips=.T.,;
Name = "Combo1"

Procedure Destroy
Clea Events
Endproc

Procedure text1.RightClick
This.Value=_Cliptext
Endproc

Procedure text1.Click
Keyboard "{CTRL+A}"
Endproc


Procedure command1.Click
Local URL
Do Case
Case Thisform.combo1.Value=1
TEXT to m.URL textmerge noshow
http://yousfi.over-blog.com/search/<<alltr(thisform.text1.value )>> /
ENDTEXT

Case Thisform.combo1.Value=2
TEXT to m.URL textmerge noshow
http://www.news2news.com/vfp/?search=<<alltr(thisform.text1.value)>>&x=0&y=0
ENDTEXT


Case Thisform.combo1.Value=3
TEXT to m.URL textmerge noshow
http://www.berezniker.com/search/apachesolr_search/ <<alltr(thisform.text1.value)>>
ENDTEXT

Case Thisform.combo1.Value=4
TEXT to m.URL textmerge noshow
http://www.atoutfox.org/recherche.asp?tables=ARTICLES%2C+APPLIS%2C+OFFRES&mots=<<alltr(thisform.text1.value)>>&x=50&y=15
ENDTEXT

Case Thisform.combo1.Value=5
TEXT to m.URL textmerge noshow
http://allapi.mentalis.org/search/results.shtml?domains=allapi.mentalis.org&q=<<allt(thisform.text1.value)>>&sa=Google+Search&sitesearch=allapi.mentalis.org&client=pub-5050931331255356&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&safe=active&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A11&hl=en
ENDTEXT

Case Thisform.combo1.Value=6
TEXT to m.URL textmerge noshow
http://www.codeproject.com/search.aspx?q=<<allt(thisform.text1.value)>>&x=7&y=5&sbo=kw
ENDTEXT

Case Thisform.combo1.Value=7
TEXT to m.URL textmerge noshow
http://weblogs.foxite.com/vfpimaging/?s=<<allt(thisform.text1.value)>>
ENDTEXT

Case Thisform.combo1.Value=8
TEXT to m.URL textmerge noshow
thisform.text1.value="rien ici-ne pas effcaer!...go"
http://www.portalfox.com/modules.php
ENDTEXT

Case Thisform.combo1.Value=9
Thisform.text1.Value="rien ici-ne pas effcaer!...go"
TEXT to m.URL textmerge noshow
http://doughennig.blogspot.com/2012_09_01_archive.html
ENDTEXT

Case Thisform.combo1.Value=10
TEXT to m.URL textmerge noshow
http://vfpx.codeplex.com/site/search?query=<<allt(thisform.text1.value)>>&ac=1
ENDTEXT

Case Thisform.combo1.Value=11
Thisform.text1.Value="rien ici-ne pas effcaer!...go"
TEXT to m.URL textmerge noshow
http://www.w3schools.com/html/
ENDTEXT


Case Thisform.combo1.Value=12
TEXT to m.URL textmerge noshow
http://social.msdn.microsoft.com/Search/en-US/?query=<<allt(thisform.text1.value)>>&rq=meta:Search.MSForums.GroupID%28e9d74e1c-beec-474f-8db7-51c27f4ae1c8%29+site:microsoft.com&rn=All+Visual+FoxPro+Forums
ENDTEXT


Case Thisform.combo1.Value=13
TEXT to m.URL textmerge noshow
http://fox.wikis.com/wc.dll?wiki~VisualFoxProWiki
ENDTEXT

Case Thisform.combo1.Value=14
TEXT to m.URL textmerge noshow
http://www.sweetpotatosoftware.com/spsblog/SearchView.aspx?q=<<allt(thisform.text1.value)>>
ENDTEXT

Case Thisform.combo1.Value=15
TEXT to m.URL textmerge noshow
http://social.msdn.microsoft.com/Search/en-US?query=<<allt(thisform.text1.value)>>&beta=0&rn=Calvin+Hsia%26%2339%3bs+WebLog&rq=site:blogs.msdn.com/b/calvin_hsia/&ac=2
ENDTEXT

Case Thisform.combo1.Value=16
TEXT to m.URL textmerge noshow
https://www.google.com/search?q=<<allt(thisform.text1.value)>>&hq=site%3Awww.foxpert.com&sa=Search
ENDTEXT

Case Thisform.combo1.Value=17
TEXT to m.URL textmerge noshow
http://myvfpblog.blogspot.com/search?q=<<allt(thisform.text1.value)>>
ENDTEXT

Case Thisform.combo1.Value=18
TEXT to m.URL textmerge noshow
http://www.foxite.com/search.aspx?m=tags&q=Yousfi+Benameur+<<allt(thisform.text1.value)>>
ENDTEXT

Case Thisform.combo1.Value=19
TEXT to m.URL textmerge noshow
https://www.iconfinder.com/search/?q=<<allt(thisform.text1.value)>>
ENDTEXT

Endcase

If Empty(Thisform.text1.Value)
Messagebox("You must fill the textbox search...",16)
Return .F.
Endi

m.URL=Allt(m.URL)
*_Cliptext=m.URL
If Messagebox(m.URL,4+64+4096,"the link is in clipboard -Valid ")=6

Local m.oo
m.oo=Newobject("hyperlink")
m.oo.NavigateTo(m.URL)

Endi
Endproc

Procedure combo1.Init
With This
.AddItem("1.OverBlog Yousfi")
.AddItem("2.News2News")
.AddItem("3.Bereznikers")
.AddItem("4.Atoutfox")
.AddItem("5.AllAPI")
.AddItem("6.CODEPROJECT")
.AddItem("7.VFP Imaging")
.AddItem("8.PortalFox")
.AddItem("9.Doug Henning")
.AddItem("10.vfp codeplex")
.AddItem("11.HTML: www.w3schools")
.AddItem("12.MSDN VFP forum")
.AddItem("13.WIKI vfp")
.AddItem("14.SPS Weblog")
.AddItem("15.Calvin Hsias")
.AddItem("16.FoxPert")
.AddItem("17.Burkhard's VFP Blog")
.AddItem("18.Yousfi Foxite")
.AddItem("19.Iconfinder")
.Style=2
.Value=1
.ListIndex=1
Endwith
Endproc
Procedure Destroy
Clea Events
Endproc

Enddefine
 

*End Code

 

A simple search web  tool
A simple search web  tool

Published on visual foxpro, search web, tool

To be informed of the latest articles, subscribe:
Comment on this post