home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 July & August / Gamestar_64_2004-07-08_dvd.iso / Programy / sidebarb67.exe / install.msi / _B22B9B4A2362BC0B8C5367867DF806C7 / _5208FC56AEA6438B9278374C05664CEA < prev    next >
Extensible Markup Language  |  2004-04-05  |  1KB  |  53 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8" ?> 
  2. <root>
  3. <bot name="Yahoo Slideshow">
  4. <![CDATA[
  5.  
  6. function DetailsPage(url){
  7.     
  8.     var exist=false;
  9.     var re = new RegExp("<img src=([^ \"]+) align=middle border=1 alt=\"([^\"]+)\" [^>]+>");               
  10.  
  11.     var text=slideshow.DownloadText(url);
  12.     var arr = re.exec(text);
  13.     if (arr!=null)
  14.     {
  15.         slideshow.AddImage(arr[1],url,arr[2]);
  16.     }
  17.     else 
  18.     {
  19.         slideshow.log("Cannot find links to image on Yahoo "+url);
  20.     } 
  21. }
  22.  
  23. function IndexPage(url)
  24. {
  25.     var exist=false;
  26.     var re = new RegExp("\<a href=\"/([^\"]+)\" class=regs\> View Photo\</a\>\<br\>");               
  27.  
  28.     var text=slideshow.DownloadText(url);
  29.     var lines=text.split("\n");
  30.     for(var i=0;i<lines.length;++i)
  31.     {
  32.         var line=lines[i];
  33.         var arr=re.exec(line);
  34.         if (arr!=null)
  35.         {
  36.             DetailsPage("http://news.yahoo.com/"+arr[1]);
  37.             exist=true;
  38.         }
  39.     }
  40.     if (!exist) 
  41.     {
  42.         slideshow.log("Cannot find links to details page on yahoo "+url);
  43.     } 
  44. }
  45.  
  46. for (var i=1;i<=5;++i) 
  47. {
  48.     IndexPage("http://news.yahoo.com/news?tmpl=index2&cid=441&pg="+i+"&cap=0");
  49. }
  50.  
  51. ]]>
  52. </bot>
  53. </root>