If anyone is intersted..  I have a search - racing.xml which displays a popup of the current US TV listings for race programming.   I might check it in soon...
 
Monty
 
<search function="racing">
   <name>Racing TV Coverage</name>
   <description>Displays a current TV listing of racing events.
      <div class="helpboxDescLabels">Note all times are US Eastern</div>
   </description>
   <link>http://www.geocities.com/racefantv/USTV.htm</link>
   <category>Fun</category>
   <script><![CDATA[
   function racing(q){
   if( q == "?" ){
      qsfind("racing /function");
      return false;
   }

   //default window sizes
   windowW = 760; windowH = 215;
   var urlstart="http://www.geocities.com/racefantv/USTV.htm";;
   
   // Set an array for the days of the week
   // We add a comma and a space to each for presentation
   // get.day will return 0 through 6 as valid values 
   word_day = new Array(
   "SUNDAY, ",
   "MONDAY, ",
   "TUESDAY, ",
   "WEDNESDAY, ",
   "THURSDAY, ",
   "FRIDAY, ",
   "SATURDAY");
   
   // Set an array for the Months of the year
   // We add a space after the month for presentation
   // get.month will return 0 through 11 as valid values 
   word_month = new Array(
   "JANUARY ",
   "FEBRUARY ",
   "MARCH ",
   "APRIL ",
   "MAY ",
   "JUNE ",
   "JULY ",
   "AUGUST ",
   "SEPTEMBER ", 
   "OCTOBER ",
   "NOVEMBER ",
   "DECEMBER ");

   // Set right_now to the current date() value
   right_now = new Date();
   var datestring=word_day[right_now.getDay()]+word_month[right_now.getMonth()]+right_now.getDate();
   var sUrl=urlstart;
   var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
   xmlHttp.open("GET", urlstart, false);
   xmlHttp.send();
   //get the response content from the remote site
   var sBody = xmlHttp.responseText;
   // Replace the break TAGs with returns or the regex wont work
   var rex = new RegExp ('\n', 'g') ;
   sBody = sBody.replace(rex, '\r') ;
   
   var re = new RegExp( ".*" + datestring + "(.*)", "im" ); 
   var r = sBody.match( re )[1];

   var tableleadin='<td colspan="3" width="100%" style="border:1px solid black;background-color: #ffff33;padding-top: 0.0416667in; padding-bottom: 0.0416667in;" valign="top"><p>';
   tableleadin+='<span style="font-weight: bold; font-family:Verdana, sans-serif"><font size="1">'+datestring;

   if (typeof r == 'undefined'){
      return;
   }else{
      var RacingSearchPopupBodyCode = "<html><head><style>table,td {border:1px solid black;margin:0px;padding-left:2px;border-collapse:collapse;}</style></head><body>";
      RacingSearchPopupBodyCode += "<table><tr> "+tableleadin+r+"</body></html>";
      var top=((screen.availheight-windowH)-38);
      var left=((screen.width-windowW)-10);
      popupImage = window.open('','_blank','width='+windowW+', height='+windowH+',toolbar=0,status=0,titlebar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,left='+left+',top='+top);
      popupImage.document.open();
      popupImage.document.write(RacingSearchPopupBodyCode);
      popupImage.document.close()
      popupImage.document.title='US Racing TV times (Eastern Timezone)';      
   }//if
} //function
  ]]></script>
</search>

Reply via email to