Have you ever wanted to add a specialty Google search box for your website that only found mp3, xls, doc, or other files of specific extensions? Well using a little JavaScript and tweaking Google’s code, it’s very simple to add a specialty Google search box to your website.
Here’s an example of a search box that only finds mp3 files.
Try searching for Daft Punk
Amazing, so how did I do this? Here’s the original JavaScript from Google to add a standard web search box to your website:
<!-- Search Google --> <center> <FORM method=GET action="http://www.google.com/search"> <input type=hidden name=ie value=UTF-8> <input type=hidden name=oe value=UTF-8> <TABLE style="background-color:#ffffff;"><tr><td> <A HREF="http://www.google.com/"> <IMG SRC="http://www.google.com/logos/Logo_40wht.gif" ALT="Google" align="absmiddle" style="border:0;"></A> <INPUT TYPE=text name=q size=25 maxlength=255 value=""> <INPUT type=submit name=btnG VALUE="Google Search"> </td></tr></TABLE> </FORM> </center> <!-- Search Google -->
Here’s a little JavaScript you need to find only mp3 files. Notice, I am just using the “intitle” and “-” syntax to narrow the search results.
<!-- Search Script --> function submitform() { var new_query="intitle:index.of \"mp3\" \"" +document.gs.query.value +"\"-htm -html -php -asp \"Last Modified\""; document.gs.query.value=new_query; } <!-- End Search Script -->
In the above code, document.gs.query.value is just what the user originally typed.
Here’s the revised Google search code that implements the above JavaScript to make a specialty Google search happen:
<script type='text/javascript' src='search.js'></script> <!-- Search Google --><center><form action="http://www.google.com/search" method="get" name="gs" onsubmit="return submitform();" ><input type="hidden" value="UTF-8" name="ie" /> <input type="hidden" value="UTF-8" name="oe" /><table style="background-color:#ffffff;"> <tr> <td><a href="http://www.google.com/"> <img style="border:0;" alt="Google" src="http://www.google.com/logos/Logo_40wht.gif" /></a> <input type="text" maxlength="255" size="25" name="query" /> <input type="submit" value="mp3 Search" name="btnG" /></td> </tr> </table> </form> </center> <!-- Search Google -->
If you wanted to make some money, you could modify Google’s Adsense Search Box to search for only mp3, mp4, mpeg, etc… However, that would violate the Google’s Adsense Terms of Service.
Is Flixya Violating Google Adsense TOS?
11Aug06Flixya is a start-up video sharing service, much like YouTube and Google Video. Unlike its competitors, Flixya provides user incentives to share and upload videos. Flixya’s Revenue Sharing program offers a 50/50 split of all revenue earned from Adsense, Google’s Pay-Per-Click advertising program. The more video links you provide to Flixya, the greater your chances of making PPC revenue on the site.
Google’s Program Policies, however, state the following rules regarding incentives,
Google’s Policy also states the following about labeling ads,
For purposes of these policies, “referral buttons are considered to be ‘Google ads'”. Yet, before and after users sign up for accounts with Flixya, they are shown several advertisements that direct them to sign up for Google Adsense as a direct incentive to make money. It seems apparent that instructing users to “Sign up for Google’s Ads to Share In Flixya’s Revenue Sharing Program” and labeling referral ads with the phrase “Sign Up” are violations of Adsense TOS. Adsense users should be further concerned that using Flixya’s Revenue Sharing Program and viewing videos on Flixya will cause an increase in page impressions with Google Adsense, which is a per se violation of Google’s TOS. What’s the likely penalty? Goodbye Adsense account.