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
Solved

to search (in a way)

Posted on 1999-01-28
9
186 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
  • 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

839 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