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
General Forums
Newcomers Forum
EPG Genre Mapping
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="gonzo90017" data-source="post: 1055436" data-attributes="member: 129471"><p>It's kind of working for me. This is what my batch file looks like:</p><p><strong>cscript //NoLogo getcat.vbs C:\xml\xmltv.xml C:\xml\xmltvmp.xml</strong></p><p></p><p>The problem is that getcat.vbs wont run unless <strong>xmltvmp.xml</strong> is present before hand.</p><p>This doesn't happen with the 1st version of the script.</p><p></p><p>Also I tried adding "Kids" and "Children" to the script:</p><p>[CODE]Const ForReading = 1</p><p>Const ForWriting = 2</p><p>Const TristateUseDefault = -2, TristateTrue = 1, TristateFalse = 0</p><p></p><p>' input files from argment, open file for reading</p><p>strRdFile = WScript.Arguments.Item(0)</p><p>strWrFile = WScript.Arguments.Item(1)</p><p>Set objFSO = CreateObject("Scripting.FileSystemObject")</p><p>Set objFile = objFSO.OpenTextFile(strRdFile, ForReading)</p><p>Set objWrFile = objFSO.OpenTextFile(strWrFile, ForWriting)</p><p></p><p>intCnt = 0</p><p>strSavedCat = " <category>None</category>"</p><p></p><p>Do Until objFile.AtEndOfStream</p><p> strLine = objFile.ReadLine</p><p></p><p>'**********************</p><p>' top half, for lines that are NOT "category"</p><p>'**********************</p><p> If InStr(strLine, "<category") = 0 Then</p><p></p><p> '*** check if there is a saved "category", do echo to write to file</p><p> '*** reset state until finding the next "category"</p><p> If intCnt > 0 Then</p><p> objWrFile.Write strSavedCat & vbCrLf</p><p> intCnt = 0</p><p> strSavedCat = " <category>None</category>"</p><p> End If</p><p> </p><p> '*** echo lines from tvguide.xml and write to file</p><p> objWrFile.Write strLine & vbCrLf</p><p></p><p> Else</p><p> '**********************</p><p> ' bottom half, for lines that ARE "category"</p><p> '**********************</p><p> intCnt = intCnt + 1</p><p></p><p> '*** save junk category if saved = "None"</p><p> If InStr(strLine, "Series") Or InStr(strLine, "General") Or InStr(strLine, "Other")Then</p><p> If InStr(strSavedCat, "None") Then</p><p> strSavedCat = strLine</p><p> End If</p><p> '*** ignore Episodic</p><p> ElseIf InStr(strLine, "Episodic") Then</p><p> '*** always save Movie, overwrite Drama, Action, etc</p><p> ElseIf InStr(strLine, "Movie") Then</p><p> strSavedCat = strLine</p><p> Else</p><p> '*** check if saved = "good" catergory, don't overwrite "good", add more ElseIf to add "good"</p><p> If InStr(strSavedCat, "Drama") Or InStr(strSavedCat, "Action")Then</p><p> ElseIf InStr(strSavedCat, "Current") Or InStr(strSavedCat, "Comedy")Then</p><p> ElseIf InStr(strSavedCat, "Movie") Then</p><p> ElseIf InStr(strSavedCat, "Football") Or InStr(strSavedCat, "Basketball") Then</p><p> ElseIf InStr(strSavedCat, "Soccer") Or InStr(strSavedCat, "Golf")Then</p><p> ElseIf InStr(strSavedCat, "Children") Or InStr(strSavedCat, "Kids")Then</p><p> Else</p><p> '*** saved = new categoruy</p><p> strSavedCat = strLine</p><p> End If</p><p> End If</p><p> End If</p><p>Loop</p><p>objFile.Close</p><p>objWrFile.Close[/CODE]</p><p></p><p>So I can keep those categories:</p><p>[CODE]<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com"></p><p> <title lang="en">Eliot Kid *</title></p><p> <sub-title lang="en">The Bathroom Monster; Igor</sub-title></p><p> <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc></p><p> <category lang="en">Action/Adventure</category></p><p> <category lang="en">Adventure</category></p><p> <category lang="en">Children</category></p><p> <category lang="en">Comedy</category></p><p> <category lang="en">Family/Children</category></p><p> <category lang="en">General</category></p><p> <category lang="en">Kids</category></p><p> <category lang="en">Series</category></p><p> <episode-num system="ms_progid">1.293936069</episode-num></p><p> <episode-num system="onscreen">126</episode-num></p><p> <audio></p><p> <stereo>stereo</stereo></p><p> </audio></p><p> <new /></p><p> <rating system="VCHIP"></p><p> <value>TV-Y7</value></p><p> </rating></p><p> </programme>[/CODE]</p><p></p><p>But it's not working:</p><p>[CODE]<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com"></p><p> <title lang="en">Eliot Kid *</title></p><p> <sub-title lang="en">The Bathroom Monster; Igor</sub-title></p><p> <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc></p><p> <category lang="en">Action/Adventure</category></p><p> <episode-num system="ms_progid">1.293936069</episode-num></p><p> <episode-num system="onscreen">126</episode-num></p><p> <audio></p><p> <stereo>stereo</stereo></p><p> </audio></p><p> <new /></p><p> <rating system="VCHIP"></p><p> <value>TV-Y7</value></p><p> </rating></p><p> </programme>[/CODE][DOUBLEPOST=1389664116][/DOUBLEPOST]EDIT </p><p>I guess I added "Kids" to the wrong section. After adding it to:</p><p></p><p>[CODE] '*** always save Movie, overwrite Drama, Action, etc</p><p> ElseIf InStr(strLine, "Movie") Then</p><p> ElseIf InStr(strLine, "Kids") Then</p><p> strSavedCat = strLine</p><p> Else[/CODE]</p><p>It's no longer stripping it from the xml file.</p></blockquote><p></p>
[QUOTE="gonzo90017, post: 1055436, member: 129471"] It's kind of working for me. This is what my batch file looks like: [B]cscript //NoLogo getcat.vbs C:\xml\xmltv.xml C:\xml\xmltvmp.xml[/B] The problem is that getcat.vbs wont run unless [B]xmltvmp.xml[/B] is present before hand. This doesn't happen with the 1st version of the script. Also I tried adding "Kids" and "Children" to the script: [CODE]Const ForReading = 1 Const ForWriting = 2 Const TristateUseDefault = -2, TristateTrue = 1, TristateFalse = 0 ' input files from argment, open file for reading strRdFile = WScript.Arguments.Item(0) strWrFile = WScript.Arguments.Item(1) Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strRdFile, ForReading) Set objWrFile = objFSO.OpenTextFile(strWrFile, ForWriting) intCnt = 0 strSavedCat = " <category>None</category>" Do Until objFile.AtEndOfStream strLine = objFile.ReadLine '********************** ' top half, for lines that are NOT "category" '********************** If InStr(strLine, "<category") = 0 Then '*** check if there is a saved "category", do echo to write to file '*** reset state until finding the next "category" If intCnt > 0 Then objWrFile.Write strSavedCat & vbCrLf intCnt = 0 strSavedCat = " <category>None</category>" End If '*** echo lines from tvguide.xml and write to file objWrFile.Write strLine & vbCrLf Else '********************** ' bottom half, for lines that ARE "category" '********************** intCnt = intCnt + 1 '*** save junk category if saved = "None" If InStr(strLine, "Series") Or InStr(strLine, "General") Or InStr(strLine, "Other")Then If InStr(strSavedCat, "None") Then strSavedCat = strLine End If '*** ignore Episodic ElseIf InStr(strLine, "Episodic") Then '*** always save Movie, overwrite Drama, Action, etc ElseIf InStr(strLine, "Movie") Then strSavedCat = strLine Else '*** check if saved = "good" catergory, don't overwrite "good", add more ElseIf to add "good" If InStr(strSavedCat, "Drama") Or InStr(strSavedCat, "Action")Then ElseIf InStr(strSavedCat, "Current") Or InStr(strSavedCat, "Comedy")Then ElseIf InStr(strSavedCat, "Movie") Then ElseIf InStr(strSavedCat, "Football") Or InStr(strSavedCat, "Basketball") Then ElseIf InStr(strSavedCat, "Soccer") Or InStr(strSavedCat, "Golf")Then ElseIf InStr(strSavedCat, "Children") Or InStr(strSavedCat, "Kids")Then Else '*** saved = new categoruy strSavedCat = strLine End If End If End If Loop objFile.Close objWrFile.Close[/CODE] So I can keep those categories: [CODE]<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com"> <title lang="en">Eliot Kid *</title> <sub-title lang="en">The Bathroom Monster; Igor</sub-title> <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc> <category lang="en">Action/Adventure</category> <category lang="en">Adventure</category> <category lang="en">Children</category> <category lang="en">Comedy</category> <category lang="en">Family/Children</category> <category lang="en">General</category> <category lang="en">Kids</category> <category lang="en">Series</category> <episode-num system="ms_progid">1.293936069</episode-num> <episode-num system="onscreen">126</episode-num> <audio> <stereo>stereo</stereo> </audio> <new /> <rating system="VCHIP"> <value>TV-Y7</value> </rating> </programme>[/CODE] But it's not working: [CODE]<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com"> <title lang="en">Eliot Kid *</title> <sub-title lang="en">The Bathroom Monster; Igor</sub-title> <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc> <category lang="en">Action/Adventure</category> <episode-num system="ms_progid">1.293936069</episode-num> <episode-num system="onscreen">126</episode-num> <audio> <stereo>stereo</stereo> </audio> <new /> <rating system="VCHIP"> <value>TV-Y7</value> </rating> </programme>[/CODE][DOUBLEPOST=1389664116][/DOUBLEPOST]EDIT I guess I added "Kids" to the wrong section. After adding it to: [CODE] '*** always save Movie, overwrite Drama, Action, etc ElseIf InStr(strLine, "Movie") Then ElseIf InStr(strLine, "Kids") Then strSavedCat = strLine Else[/CODE] It's no longer stripping it from the xml file. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
General Forums
Newcomers Forum
EPG Genre Mapping
Contact us
RSS
Top
Bottom