|
Add a YouTube search box to my site?I want to add a YouTube search box to my Web site. Can it be done? Can it be done? Pshaw! Anything can be built or reverse engineered given the time and motivation! There's no reason to think that Google's YouTube site is any different. The question is: is it going to be an easy reverse engineering job or a tough one, and that can be quickly ascertained by simply having a peek at the YouTube home page: ![]() As you can see, it's a rudimentary search box with the input field and a submit button. That's it. Should be quite easy to reverse engineer it! To start, we'll crack open the source code to the page and isolate the HTML for the search itself: ![]() Looks like a lot of code, but if we scrub all the non-essential code and replace the fancy, attractive button with a regular HTML "submit" button, we're left with the small HTML snippet: <form action="http://www.youtube.com/results" method="get"> <input name="search_query" type="text"> <input type="submit"> </form> That's it. Seriously. It's not pretty, but it's functional: Now let's make it a bit nicer looking by adding a box around it. This can be most easily done with some CSS styling within a "div" container, like this: <div style="border:2px dotted black;padding:7px;">
<form action="http://www.youtube.com/results" method="get"> <input name="search_query" type="text"> <input type="submit"> </form> </div> That gives us this: What do you think? Want something a wee bit more fancy? How about adding a background color to the box, and a different background color to the (larger) text input field and, for good luck, a third color for the button itself: <div style="border:2px dotted black;padding:7px;background-color:#cfc;">
<form action="http://www.youtube.com/results" method="get"> <b>Search YouTube for: </b> <input name="search_query" type="text" style="background-color:#ccf;" size="45"> <input type="submit" style="background-color:#ffc;"> </form> </div> The result: You can tweak and fiddle from here as you'd like, but that'll get you the rudiments of a YouTube search box on your site and a direction to travel for a custom fit. Good luck!
Categorized:
CGI Scripts and Web Site Programming
,
Computer and Internet Basics
(Article 9464,
Written by Dave Taylor)
Tagged: google video, hack youtube, html hacking, reverse engineering, youtube, youtube search Previous: How do I set a custom background for Google? Next: How do I validate the HTML on my Web site? Subscribe!
Great little trick, far neater way to integrate YouTube into sites! Posted by: Steve at June 14, 2010 3:47 PMI have something to say, now that you mention it, but ...
I do have a comment, now that you mention it!
|
Recommended
Recent Entries
Search
I Need Help!
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and RSS Feeds Building Web Site Traffic Business and Management CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help Google Plus Help HTML and CSS Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Mac OS X Help Pay Per Click (PPC) Advertising 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 WordPress Help |