I know that Google is the popular search engine for most folk, but I really think that Microsoft's Bing system is better and offers up more useful results. To help Bing become more successful, I'd like to have a search box on my site that utilizes the Bing search engine. Is that possible?
Dave's Answer:
I agree with you that Bing is becoming quite a credible competitor to Google and that the results are show in a useful form, including info that Google just doesn't have. I'm not sure that it'll every overtake the Google behemoth, but then again, just because Ferrari doesn't sell more cars than Ford that doesn't mean it's not a cool car!
As with the other search systems I have unwrapped and reverse engineered on the site (including Google, Google Images and YouTube), the first step with figuring out how Bing works with search is to go onto the site itself and run a search, then look at the resultant URL.
A Bing search for "cherries" (get it?) produces its results against the URL:
Now we can unwrap this by knowing a bit about how method=get Web forms work:
action=http://www.bing.com/search q=pattern go= form=QBLH qs=n sk=
Based on my experience reverse-engineering other search forms, I am going to start with the most minimal possible search box:
<input type="text" name="q" />
<input type="submit" value="Go!" />
</form>
Here's how it looks when we actually include it here on the blog entry:
Try it. Type in a search query and click on "Go!" to see what happens.
Functional, but a bit boring. Let's make it a tiny bit more attractive by adding a bit of CSS:
<div style="border:1px solid black;padding:5px;width:350">
<center> Search Bing: <input type="text" name="q" size="30" />
<input type="submit" value="Go!" />
</center>
</div>
</form>
Again, when I actually implement it here on the blog entry, this is what we get:
So that's your answer. You can tweak and fiddle from here... :-)
CommentsAbout the Author: Dave Taylor has been involved with the Internet since 1980 and is internationally known as an expert on both business and technology issues. Holder of an MSEd and MBA, author of twenty books and founder of four startups, he also runs a strategic marketing company and consults with firms seeking the best approach to working with weblogs and social networks. Dave is an award-winning speaker and frequent guest on radio and podcast programs. AskDaveTaylor.com http://www.intuitive.com/blog/




