|
|
How can I embed search results on my own page?I've read and enjoyed your articles on adding Twitter / Google search boxes to a website. I am trying to figure out a way to have one search box on my site that displays results (in a multi-column horizontal table) for multiple sources, particularly Twitter / Google / YouTube. Any help would be appreciated. Thanks! Cool idea, but I'm afraid that you're probably going to be stuck having to do some programming to get this to work. The problem is that generally all the search engines on different sites, whether it's Google or Amazon, eBay or Yelp, are built on the assumption that you hand the query string to their application and in addition to producing the search results, it also produces everything else required for the page to be a full and proper Web page. Even if you could embed an eBay search result, say, on your page, the embedded page would think it's a full page unto itself and would layout weirdly. Having said that, though, there are ways we can explore to try and solve pieces of what you seek. For example, Google has a very slick custom search capability that allows you to embed search results in your own results page. It can't include search results from other pages, but it's an interesting starting point. You could also explore using an IFRAME, an HTML entity that essentially lets you embed an entire Web page as a component of a larger page. Let's dabble in that for a minute... The trick is that you need to actually have multiple Web pages because the iframe creates a space within which another Web page is going to live. A simple version would be to actually include the Google home page within the iframe, for example, which looks like this HTML-code-wise: <iframe src="http://www.google.com/" width="530" height="250"></iframe>
If I drop this as active code onto this page, here's what you'll see: Try it. It really works. The problem, as you can see, is that Google doesn't design its search page or search results page to be embedded into another page, so it's a poor fit and confusing. Ya gotta do a lot of scrolling! You can still embed a search box into a page and hand the results to a search engine, knowing that while the presentation of the box is nice, the results are going to be a bit, um, squished. That'd be done by creating a stark, simple HTML page that just contains the element you are going to embed in the iframe, then letting your users fend for themselves once the search is completed. To integrate search results from multiple sites you really need to write some code, because you're going to need your program to execute the search and parse the results from multiple sites, then somehow integrate those results into a unified presentation (perhaps by column, as you suggest, in which case you could have each column as its own iframe, but then you can't push simultaneous results out easily and you still have the problem of search results layout within an iframe). Having written multi-site search results parsing programs in the past, I'll also warn you that it's pretty tricky because a lot of sites are constantly tweaking their pages and page layout, things that you don't realize as a user but will very quickly recognize when your parsing routines keep breaking. So, in the end, no great answer. No magic solution. You can have a workaround that kind of accomplishes what you seek, but to do what you want, you're going to have a tricky hill to climb.
More Useful HTML, JavaScript and Web Site Programming Articles:
✔ How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....
✔ Can I embed a Facebook search box on my blog site?I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...
✔ Can I use CSS for drop shadows on my blog?I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....
✔ How can I embed interactive photo panoramas on my site/blog?I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...
✔ How can I create a Twitter search URL shortcut?I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
HTML, JavaScript and Web Site Programming
(Article 9863,
Written by Dave Taylor)
Tagged: amazon, ebay, google, html, parsing web pages, search engines, yelp Previous: Review: ZAGG iPad 2 ZAGGskin Next: Apply an Amazon Gift Code / Card / Certificate to my Amazon account? Reader Comments To Date:
Rather amazingly, there are no comments on this article yet.
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |