home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 32bit / vasetup.exe / %MYDIR% / ONLINE.EBS < prev    next >
Encoding:
Text File  |  1999-10-06  |  2.8 KB  |  107 lines

  1. 'T:ONLINE.EBS
  2. ' VA 4.52 release
  3.  
  4. Global Const IM_SPECIAL = 128
  5. Global Const IM_DELETE    = 2048
  6.  
  7. Dim nummsgs As Integer
  8. Dim daily As Boolean
  9.  
  10. Declare Function UniqueFileName$
  11. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  12. Declare Sub ReportSuccess(id As String)
  13. Declare Sub ResetForum
  14.  
  15. 'T:OnlineSplitter (subroutine) (CompuServe) 
  16. ' Split message stream up
  17. Sub OnlineSplitter(t As Tracker)
  18.     ' End of previous message
  19.     CaptureRewind Len(t.match)
  20.     CaptureText Basic.Eoln$+"!end"
  21.  
  22.     ' Start of next message
  23.     CaptureText Basic.Eoln$+"!start Online_Today/"
  24.     If daily Then
  25.         CaptureText "Daily_Edition"
  26.     Else
  27.         CaptureText "Articles"
  28.     End If
  29.     CaptureText " Online_Today"+Basic.Eoln$
  30.     CaptureText Mid(t.match, 2, InStr(t.match, "OLT-")-2)
  31.  
  32.     ' Tell user we've got another message
  33.     nummsgs = nummsgs + 1
  34.     Terminal.CaptureStatus nummsgs
  35.     t.reset
  36. End Sub
  37.  
  38. 'T:OnlineGobble (subroutine) (CompuServe)
  39. ' Remove this text from the message since it's unwanted
  40. Sub OnlineGobble(t As Tracker)
  41.     CaptureRewind Len(t.match)
  42.     t.reset
  43. End Sub
  44.  
  45. 'T:OnlineToday (subroutine) (CompuServe)
  46. Sub OnlineToday(id As String, page As String, all As String)
  47.     Dim mstart As Tracker, mend As Tracker
  48.     Dim filename As String
  49.  
  50.     ResetForum
  51.     WhereAmI = ""
  52.     Comms.Send "go cis:olt-"+page+"\r"
  53.     WaitForPrompt "Prompt"
  54.     Comms.Send "go cis:olt-"+page+"\r"
  55.     WaitFor "olt-"+page
  56.     If all<>"" Then
  57.         WaitForPrompt "Prompt"
  58.         Comms.Send "all\r"
  59.         daily = True
  60.     Else
  61.         daily = False
  62.     End If
  63.  
  64.     ' Start capturing
  65.     nummsgs = 0
  66.     filename = UniqueFilename$()
  67.     Capture CAPTURE_ON, filename
  68.     Set mstart = CreateTracker("MessageStart", "\n*\x20\x20OLT-*\r", "OnlineSplitter", True, True)
  69.     Set mend = CreateTracker("MessageEnd", "\nChoice*is not available for download", "OnlineGobble", True, True)
  70.     Terminal.CaptureStatus CAPTURE_ON
  71.     Terminal.Enabled = False
  72.  
  73.     ' Get messages
  74.     Do
  75.         WaitForPrompt "Prompt"
  76.     Loop Until PromptMatches("PromptLastPage") Or PromptMatches("PromptMain")
  77.     CaptureRewind 10
  78.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  79.     Terminal.CaptureStatus CAPTURE_OFF
  80.     
  81.     ' Clean up
  82.     mstart.delete
  83.     mend.delete
  84.     Capture CAPTURE_OFF
  85.     Comms.Send "m\rgo top\r"
  86.     WaitForPrompt "Prompt"
  87.     Terminal.Enabled = True
  88.  
  89.     ' Add to import queue
  90.     If QueueFile(Session.Service, filename, IM_SPECIAL Or IM_DELETE) Then
  91.         ReportSuccess id & " : Online Today information collected"
  92.     End If
  93.     ResetForum
  94. End Sub
  95.  
  96. 'T:GetOnlineToday (subroutine) (CompuServe)
  97. Sub GetOnlineToday(id As String)
  98.     OnlineToday id, "90", "all"
  99. End Sub
  100.  
  101. 'T:GetOnlineTodayArticle (subroutine) (CompuServe)
  102. Sub GetOnlineTodayArticle(id As String, num As String)
  103.     OnlineToday id, num, ""
  104.     Terminal.Print Basic.Eoln$+"!"   ' a dirty hack - do I care?
  105. End Sub
  106.  
  107.