Thursday, September 07, 2006

The basic implementation of the Google RSS to HTML has been created. The grabbagvideo.com googleplayer page acts as media player for visitors. website visitors initally arrive at the google videos page displaying the top 20 of Google's 100 most popular videos.

Moving forward I plan on expirementing with a few different solutions for parsing the RSS feeds. The current approach involves make an XMLHTTP request from the server side to google for the Video RSS. This allows me to sort through the top 100 videos for website display. With the most popular videos beeing the landing page, the is also subnavigation links to Music VideosComedyTV ShowsSportsEducational google videos.

I even took the project one step further by implementing a search function. Try it out.
< script language="javascript" type="text/javascript">
function gSearch() {
var x;
if(!document.all) {
alert("This script only suppports IE")
}
else
{
x= document.all.videosearch;
window.open("http://www.grabbagvideo.com/videoplayer/googlevideos.aspx?sTerm=" + x.value + "&videono=10&feed=http://video.google.com/videosearch?q=" + x.value +"&amp;amp;num=100&output=rss")
}

}
< /script>

*script in this blog only supports IE, and Opens the results in a new window. If you have a popup blocker then you may have to disable it or try clicking the search button while holding the control key.

IF you would like to add this script to your website just copy and past the following code. You wil have modify it to support non IE browsers. The current production version on grabbagvideo.com does not require any client side scripting and uses Ajax on the server. In the next blog, I will provide asome more examples. and begin to break down the nurs and bolts of the code.



Copy and paste the following code to your site to add Google video search functionality to your users

< script language="javascript" type="text/javascript">
function gSearch() {
var x;
if(!document.all) {
alert("This script only suppports IE")
}
else
{
x= document.all.videosearch;
window.open("http://www.grabbagvideo.com/videoplayer/googlevideos.aspx?sTerm=" + x.value + "&videono=10&feed=http://video.google.com/videosearch?q=" + x.value +"&amp;amp;num=100&output=rss")
}

}
< /script>

< id="videosearch" style="WIDTH: 110px" value="Funny Videos" name="videosearch">< id="searchbutton" style="WIDTH: 100px" onclick="gSearch()" type="submit" value="Search Videos" name="searchbutton">