WinBatch Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: stanl on June 05, 2013, 09:35:06 am

Title: RSS'ing the new forum
Post by: stanl on June 05, 2013, 09:35:06 am
I assume someone has a script to do this; if not I may have something in my archives to get started.
 
or maybe a PS two-liner via WB 2013 CLR:
Code: [Select]
$url = "http://forum.winbatch.com/index.php?action=.xml;type=rss
Invoke-RestMethod $url | Select Title, Link
Title: Re: RSS'ing the new forum
Post by: Deana on June 05, 2013, 09:52:17 am
Here is another option using COM Automation:

Code: Winbatch
strURL="http://forum.winbatch.com/index.php?action=.xml;type=rss"
rssfeedfile = DirScript():"WBFeed.xml"
objHTTP = ObjectCreate("MSXML2.XMLHTTP")
objHTTP.Open("GET", strURL, @FALSE)
objHTTP.Send()
rssfeeddata = objHTTP.ResponseText
;Pause('rssfeeddata', rssfeeddata)
FilePut( rssfeedfile, rssfeeddata )
Run(rssfeedfile,"")
Exit
 
Title: Re: RSS'ing the new forum
Post by: stanl on June 06, 2013, 06:44:13 am
Here is another option using COM Automation:
Nice, but that still leaves the parsing to more coding. The CLR route can break down the individual elements from the pipeline and this shows off the 'neatness' of WB2013.
I haven't played with RSS for 2 years, but this looks like a nice spare-time project as this new board supports RSS.
Title: Re: RSS'ing the new forum
Post by: stanl on June 07, 2013, 06:31:25 am
Been trying to extract the posts in a GridView. Issue is with the description tag which holds CDATA. If I pipe it as | title, link, description I only get "description" as output. However, if I call
rss.item.description I get the CDATA.
 
Seems like xPath is the alternative. :'(