Solved

to search (in a way)

Posted on 1999-01-28
9
200 Views
Last Modified: 2013-12-25
i want to make it so that i can enter a word into a
text box and then hit a button "search" and then that
will go to a given search engine (say yahoo.com) and
it will give me the relevant results

so its just like searching directly on the search engine
but doing it from my page...

thanks
paddy
0
Comment
Question by:paddytsr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 7

Expert Comment

by:jconde
ID: 1832439
Hi, that's pretty simple.....if there's only one search engine you will be using....what you need to do, is to call yahoos search cgi, and send the correct parameters.

I.e (THis goes in your html template)
<FORM ACTION="http://search.yahoo.com/bin/search">
<INPUT TYPE="TEXT" NAME="p">
<INPUT TYPE="SUBMIT" VALUE="SEARCH">
</FORM>

If you want to have multiple search engines that one can choose from, you will need to do the same, but with a CGI that will redirect to the selected search engine with it's parameters.

Regards,

Jorge
0
 

Author Comment

by:paddytsr
ID: 1832440
thanks,
theres just one more thing that id like to know if its possible to do...

when i search www.yahoo.de (the german yahoo) for a word say "test" i get a lot of links and some sentences beside some links with a sentence containing the word "text"

Is it possible to just get a list of these sentences with the word searched for when u hit search for the word?

Thanks
Paddy
0
 

Author Comment

by:paddytsr
ID: 1832441
Adjusted points to 55
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:paddytsr
ID: 1832442
and also how exactly do you do it for multiple search engines.....
0
 
LVL 7

Accepted Solution

by:
jconde earned 60 total points
ID: 1832443
What do you mean by a List of sentences that contain the searched word???.....do you mean, in order for you to display the results with your own html format?

To search multiple search engines it's quite tricky!

I will give you the algorithm of what you need:

1) Receive the search string and the search engine that will be used
2) Open a socket to the search engine
3) Send the path and parameters to the search engines httpd
4) While (Not end of socket stream)
5) Print the contents of the socket stream
6) Close the socket.

If you do this, since you have complete control over the html before it's printed out on the browser, you can format the html to your convenience.

P.S.  No need to reject my answer, I would have still helped you all the way through.
0
 

Author Comment

by:paddytsr
ID: 1832444
Yeah, i want to display the results with my own html format... in a way just "real life" examples of how the word appears in
various sentences...

can you be any more precise on the algorithm for multiple search
engines, i'm new to all this and dont have a clue how to go about writing the code....

sorry about the rejected answer, im new to this site too
thanks
paddy
0
 
LVL 7

Expert Comment

by:jconde
ID: 1832445
What httpd are you using??...

I have some samples that do pretty much what you're looking for but they're written with php3.....will it work for you?
0
 

Author Comment

by:paddytsr
ID: 1832446
what is php3?
paddy

0
 

Author Comment

by:paddytsr
ID: 1832447
i am using an apache server on unix...
and im new to it, i only know the basics
paddy
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question