home *** CD-ROM | disk | FTP | other *** search
- 'T:ONLINE.EBS
- ' VA 4.52 release
-
- Global Const IM_SPECIAL = 128
- Global Const IM_DELETE = 2048
-
- Dim nummsgs As Integer
- Dim daily As Boolean
-
- Declare Function UniqueFileName$
- Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
- Declare Sub ReportSuccess(id As String)
- Declare Sub ResetForum
-
- 'T:OnlineSplitter (subroutine) (CompuServe)
- ' Split message stream up
- Sub OnlineSplitter(t As Tracker)
- ' End of previous message
- CaptureRewind Len(t.match)
- CaptureText Basic.Eoln$+"!end"
-
- ' Start of next message
- CaptureText Basic.Eoln$+"!start Online_Today/"
- If daily Then
- CaptureText "Daily_Edition"
- Else
- CaptureText "Articles"
- End If
- CaptureText " Online_Today"+Basic.Eoln$
- CaptureText Mid(t.match, 2, InStr(t.match, "OLT-")-2)
-
- ' Tell user we've got another message
- nummsgs = nummsgs + 1
- Terminal.CaptureStatus nummsgs
- t.reset
- End Sub
-
- 'T:OnlineGobble (subroutine) (CompuServe)
- ' Remove this text from the message since it's unwanted
- Sub OnlineGobble(t As Tracker)
- CaptureRewind Len(t.match)
- t.reset
- End Sub
-
- 'T:OnlineToday (subroutine) (CompuServe)
- Sub OnlineToday(id As String, page As String, all As String)
- Dim mstart As Tracker, mend As Tracker
- Dim filename As String
-
- ResetForum
- WhereAmI = ""
- Comms.Send "go cis:olt-"+page+"\r"
- WaitForPrompt "Prompt"
- Comms.Send "go cis:olt-"+page+"\r"
- WaitFor "olt-"+page
- If all<>"" Then
- WaitForPrompt "Prompt"
- Comms.Send "all\r"
- daily = True
- Else
- daily = False
- End If
-
- ' Start capturing
- nummsgs = 0
- filename = UniqueFilename$()
- Capture CAPTURE_ON, filename
- Set mstart = CreateTracker("MessageStart", "\n*\x20\x20OLT-*\r", "OnlineSplitter", True, True)
- Set mend = CreateTracker("MessageEnd", "\nChoice*is not available for download", "OnlineGobble", True, True)
- Terminal.CaptureStatus CAPTURE_ON
- Terminal.Enabled = False
-
- ' Get messages
- Do
- WaitForPrompt "Prompt"
- Loop Until PromptMatches("PromptLastPage") Or PromptMatches("PromptMain")
- CaptureRewind 10
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Terminal.CaptureStatus CAPTURE_OFF
-
- ' Clean up
- mstart.delete
- mend.delete
- Capture CAPTURE_OFF
- Comms.Send "m\rgo top\r"
- WaitForPrompt "Prompt"
- Terminal.Enabled = True
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_SPECIAL Or IM_DELETE) Then
- ReportSuccess id & " : Online Today information collected"
- End If
- ResetForum
- End Sub
-
- 'T:GetOnlineToday (subroutine) (CompuServe)
- Sub GetOnlineToday(id As String)
- OnlineToday id, "90", "all"
- End Sub
-
- 'T:GetOnlineTodayArticle (subroutine) (CompuServe)
- Sub GetOnlineTodayArticle(id As String, num As String)
- OnlineToday id, num, ""
- Terminal.Print Basic.Eoln$+"!" ' a dirty hack - do I care?
- End Sub
-
-