home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
WebEPG and OzTivo - Username and Password?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cartman" data-source="post: 76323" data-attributes="member: 19059"><p>OK, I've learned a little now about making a vbs script and this seems to work for me. I've checked out plenty of other scripts so there's nothing totally new about what I've done here. I guess I'm just after a little feedback from people who know more about this stuff.</p><p></p><p>All I've done is created this code as a .vbs text file and I can run it on the downloaded <a href="http://minnie.tuhs.org/tivo-bin/xmlguide.pl" target="_blank">http://minnie.tuhs.org/tivo-bin/xmlguide.pl</a> file where I've already downloaded it. I'm trying to work out how to download it all in one go but that may take me some more time. You'll also need a file called chanid.xml that has the entries of each channel your file grabs just like DogBoy1169 has mentioned. If you want an example of that I can post the one I am using for foxtel.</p><p></p><p>[CODE]</p><p>Option Explicit</p><p>' sets UTC timezone in xml oztivo data file</p><p>' and adds channel ids from the chanid.xml file</p><p>' I hope it works!</p><p></p><p>Const ForReading = 1</p><p>Const ForWriting = 2</p><p></p><p>Dim objFSO</p><p>Dim objFile</p><p>Dim strFile</p><p>Dim strOutput</p><p>Dim strText</p><p>Dim strChanText</p><p>Dim strNewText</p><p>Dim strOldStartText</p><p>Dim strNewStartText</p><p>Dim strOldStopText</p><p>Dim strNewStopText</p><p>Dim strChanID</p><p>Dim strOldChanText</p><p>Dim strNewChanText</p><p></p><p>strFile = ScriptPath & "\xmlguide.pl"</p><p>strChanID = ScriptPath & "\chanid.xml"</p><p></p><p>Function ReadFiles()</p><p> On Error Resume Next</p><p> Set objFSO = CreateObject("Scripting.FileSystemObject")</p><p> Set objFile = objFSO.OpenTextFile(strChanID, ForReading)</p><p> strChanText = objFile.ReadAll</p><p> objFile.Close</p><p> Set objFSO = CreateObject("Scripting.FileSystemObject")</p><p> Set objFile = objFSO.OpenTextFile(strFile, ForReading)</p><p> strText = objFile.ReadAll</p><p> objFile.Close</p><p> If Err = 0 Then</p><p> ReadFiles = True</p><p> End If</p><p>End Function </p><p></p><p>Function ParseText()</p><p> On Error Goto 0</p><p> On Error Resume Next</p><p> strOldChanText = "xmlguide.pl" & chr(34) & ">"</p><p> strNewChanText = "xmlguide.pl" & chr(34) & ">" & vbCrLf & vbCrLf & strChanText & vbCrLf</p><p> strNewText = Replace(strText, strOldChanText, strNewChanText) </p><p> strOldStartText = chr(34) & " stop"</p><p> strNewStartText = " +0000" & chr(34) & " stop"</p><p> strNewText = Replace(strNewText, strOldStartText, strNewStartText)</p><p> strOldStopText = chr(34) & " channel"</p><p> strNewStopText = " +0000" & chr(34) & " channel"</p><p> strNewText = Replace(strNewText, strOldStopText, strNewStopText)</p><p> If Err = 0 Then</p><p> ParseText = True</p><p> End If</p><p>End Function </p><p></p><p>Function WriteFile()</p><p> On Error Goto 0</p><p> On Error Resume Next</p><p> Set objFSO = CreateObject("Scripting.FileSystemObject")</p><p> Set objFile = objFSO.OpenTextFile(strFile, ForWriting)</p><p> objFile.WriteLine strNewText</p><p> objFile.Close</p><p> If Err = 0 Then</p><p> WriteFile = True</p><p> End If</p><p>End Function</p><p></p><p>Function ScriptPath()</p><p> ScriptPath = CreateObject("Scripting.FileSystemObject")._</p><p> GetParentFolderName(Wscript.ScriptFullName)</p><p>End Function</p><p></p><p>Sub ParseFile()</p><p> If ReadFiles = True Then </p><p> If ParseText = True Then </p><p> If WriteFile = True Then</p><p> MsgBox "File Updated Successfully"</p><p> Else</p><p> MsgBox "Write File Error!" & vbCrLf & Err.Description</p><p> End If </p><p> Else</p><p> MsgBox "Parse Text Error!" & vbCrLf & Err.Description</p><p> End If</p><p> Else</p><p> MsgBox "Read File Error!" & vbCrLf & Err.Description</p><p> End If</p><p>End Sub</p><p></p><p>Call ParseFile</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="cartman, post: 76323, member: 19059"] OK, I've learned a little now about making a vbs script and this seems to work for me. I've checked out plenty of other scripts so there's nothing totally new about what I've done here. I guess I'm just after a little feedback from people who know more about this stuff. All I've done is created this code as a .vbs text file and I can run it on the downloaded [URL="http://minnie.tuhs.org/tivo-bin/xmlguide.pl"]http://minnie.tuhs.org/tivo-bin/xmlguide.pl[/URL] file where I've already downloaded it. I'm trying to work out how to download it all in one go but that may take me some more time. You'll also need a file called chanid.xml that has the entries of each channel your file grabs just like DogBoy1169 has mentioned. If you want an example of that I can post the one I am using for foxtel. [CODE] Option Explicit ' sets UTC timezone in xml oztivo data file ' and adds channel ids from the chanid.xml file ' I hope it works! Const ForReading = 1 Const ForWriting = 2 Dim objFSO Dim objFile Dim strFile Dim strOutput Dim strText Dim strChanText Dim strNewText Dim strOldStartText Dim strNewStartText Dim strOldStopText Dim strNewStopText Dim strChanID Dim strOldChanText Dim strNewChanText strFile = ScriptPath & "\xmlguide.pl" strChanID = ScriptPath & "\chanid.xml" Function ReadFiles() On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strChanID, ForReading) strChanText = objFile.ReadAll objFile.Close Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strFile, ForReading) strText = objFile.ReadAll objFile.Close If Err = 0 Then ReadFiles = True End If End Function Function ParseText() On Error Goto 0 On Error Resume Next strOldChanText = "xmlguide.pl" & chr(34) & ">" strNewChanText = "xmlguide.pl" & chr(34) & ">" & vbCrLf & vbCrLf & strChanText & vbCrLf strNewText = Replace(strText, strOldChanText, strNewChanText) strOldStartText = chr(34) & " stop" strNewStartText = " +0000" & chr(34) & " stop" strNewText = Replace(strNewText, strOldStartText, strNewStartText) strOldStopText = chr(34) & " channel" strNewStopText = " +0000" & chr(34) & " channel" strNewText = Replace(strNewText, strOldStopText, strNewStopText) If Err = 0 Then ParseText = True End If End Function Function WriteFile() On Error Goto 0 On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strFile, ForWriting) objFile.WriteLine strNewText objFile.Close If Err = 0 Then WriteFile = True End If End Function Function ScriptPath() ScriptPath = CreateObject("Scripting.FileSystemObject")._ GetParentFolderName(Wscript.ScriptFullName) End Function Sub ParseFile() If ReadFiles = True Then If ParseText = True Then If WriteFile = True Then MsgBox "File Updated Successfully" Else MsgBox "Write File Error!" & vbCrLf & Err.Description End If Else MsgBox "Parse Text Error!" & vbCrLf & Err.Description End If Else MsgBox "Read File Error!" & vbCrLf & Err.Description End If End Sub Call ParseFile [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
WebEPG and OzTivo - Username and Password?
Contact us
RSS
Top
Bottom