home *** CD-ROM | disk | FTP | other *** search
/ MACD 7 / MACD7.iso / www / omnipresence / programs / ibfindurl1.3.lha / IBfindURL / eng / CheckURL.ibrx next >
Encoding:
Text File  |  1997-04-02  |  2.9 KB  |  128 lines

  1. /* $VER: IBcheckURL.ibrx 1.3e ©1997 by mike@kily.ruhr.de (http://home.pages.de/~kilyman)
  2.  
  3. Ibrowse Arexx Script checks - is the shown URL in HotList?
  4.  
  5. Problem:
  6.  
  7. Everybody collects URLs in his IBrowse Hotlist. But if you ADD a "NEW" URL
  8. do you really Know ALLWAYS that this URL is not also in your Hotlist?!
  9. Perhaps NOT, okay, here comes the sollution.
  10.  
  11. Solution:
  12.  
  13. This Scripts simply compares your IBrowse Hotlist entrys with the actual
  14. URL. If if Founds a matching Entry it shows Up a Requester.
  15.  
  16. Install:
  17.  
  18. This Script requires reqtools.library and rexxreqtools.library
  19. (both in Aminet/ReqToolsUsr.lha)
  20.  
  21. Copy this script to the IBrowse Homepath
  22. Put in IBrowse Arexx-Menu as Check URL.
  23.  
  24.  
  25. Please send me a Email if you use this script.
  26.  
  27. ************************************************************************
  28.  
  29. config variables:                                                     */
  30.  
  31.  
  32. MAXWID=50
  33. /* this is the maximum URL length which the Requester Shows.
  34. (some URLs are really long and a wide Req don't look good)
  35. */
  36.  
  37. IBHOTLIST='ibrowse-hotlist.html'
  38. /* complete Path for IBrowse Hotlist if script is not in IB-HomePath.
  39. */
  40.  
  41. RTTAGS='rt_pubscrname=IBROWSE rt_font=helvetica.font/13'
  42. /* IBrowse Pubscreenname and default Reqtools-Font
  43. */
  44.  
  45. /**********************************************************************/
  46.  
  47.  
  48.  
  49. OPTIONS RESULTS
  50.  
  51. if ~exists("Libs:rexxreqtools.library") then do
  52.     echo "LIBS:RexxReqTools.Library not available."
  53.     exit
  54. end
  55.  
  56. ok=addlib("rexxreqtools.library",0,-30)
  57.  
  58. address 'IBROWSE'
  59. 'QUERY URL'
  60. IBURL = result
  61.  
  62. NL = '0a'x
  63. group="- no group -"
  64.  
  65. IF Open('hotlist',IBHOTLIST,'r') THEN
  66. DO
  67.     DO UNTIL Eof('hotlist')
  68.       zeile=ReadLn('hotlist')
  69.  
  70.       if left(zeile,7)="<LI><B>" then
  71.       do
  72.        agroup=group
  73.        parse var zeile '<LI><B>'group'</B>'dummy
  74.       end
  75.  
  76.       if left(zeile,5)="</UL>" then group=agroup
  77.  
  78.       if left(zeile,11)="<LI><A HREF" then
  79.       do
  80.          parse var zeile '<LI><A HREF="'url'"'dummy'>'name'</A>'
  81.  
  82.          IF UPPER(url)==UPPER(IBURL) THEN
  83.          do
  84.           erfolg=1
  85.  
  86.           if length(iburl)>MAXWID then ibsurl=left(ibURL,MAXWID)||"..."
  87.            else ibsurl=iburl
  88.  
  89.           call rtezrequest( "Title: " name||NL||"Group: " group||NL||,
  90.            "URL: " ibsURL, "next...|Open HotList|Abort" ,"Matching URL found !" , RTTAGS)
  91.  
  92.           if rtresult == 0 then exit
  93.  
  94.           if rtresult == 2 & show('P','IBROWSE') then
  95.           do
  96.             address 'IBROWSE'
  97.             OPENHOTLIST
  98.             EXIT
  99.           end
  100.  
  101.          end
  102.  
  103.       end
  104.  
  105.     END
  106.     Call Close('hotlist')
  107.  
  108.     if erfolg~=1 then
  109.     do
  110.      if length(iburl)>MAXWID then iburl=left(ibURL,MAXWID)||"..."
  111.  
  112.      call rtezrequest( "URL: "IBURL" is not in HotList !" , "Ok...|Open HotList" ,"Search result" , RTTAGS)
  113.  
  114.      if rtresult == 0 & show('P','IBROWSE') then
  115.      do
  116.        address 'IBROWSE'
  117.        OPENHOTLIST
  118.      end
  119.  
  120.      EXIT
  121.  
  122.     END
  123.     call rtezrequest("no more matching URLs in Hotlist !" , "Fine...","Search finished" , RTTAGS)
  124.  
  125. end
  126.  
  127. EXIT
  128.