Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:53:51+00:00 2026-06-13T00:53:51+00:00

Hello there im trying to figure out how i can parse RSS feeds with

  • 0

Hello there im trying to figure out how i can parse RSS feeds with VBS and display the contents into cmd. I got some code i have found around the net. this is what i got so far.

Batchfile:

:news
start scripts\xml\getxml.exe -N --directory-prefix=%temp% http://feeds.bbci.co.uk/news/rss.xml
:newscheck
if NOT EXIST %temp%\rss.xml (
ping 123.45.67.89 -n 1 -w 500 > nul.
goto newscheck
)
start scripts\news\parsebbcnews.vbs
ping 123.45.67.89 -n 1 -w 500 > nul.
:newsxmlparsecheck
if NOT EXIST %temp%\bbcnews.txt (
ping 123.45.67.89 -n 1 -w 500 > nul.
goto newsxmlparsecheck
)
set /p headline= <%temp%\bbcnews.txt
echo %headline%
%speech% "%headline%"
del %temp%\rss.xml
del %temp%\bbcnews.txt
goto start

then this starts the VBS:

    Dim xmlDoc, objNodeList, plot

Set wshShell = CreateObject( "WScript.Shell" )
tfolder =  wshShell.ExpandEnvironmentStrings("%TEMP%")
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load(tfolder & "\rss.xml")
Set objNodeList = xmlDoc.getElementsByTagName("channel/item/description") 'Node to search for
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Write all found results into forecast.txt
Const ForWriting = 2
Set objTextFile = objFSO.OpenTextFile _
    (tfolder & "\bbcnews.txt", ForWriting, True)
If objNodeList.length > 0 then
For each x in objNodeList
plot=x.Text
objTextFile.WriteLine(plot)
Next 'just remove this?
objTextFile.Close   
End If

'Extract todays data (first line) from 'forecast.txt' and write each data type to seperate line in today.txt
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    (tfolder & "\bbcnews.txt", ForReading)
    strNextLine = objTextFile.Readline
    'currentsplit = Split(strNextLine , ", ")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(tfolder & "\headline.txt", ForWriting, True)  
    objTextFile.WriteLine(strNextLine)

This gets 1 news rss feed from bbc. I want also to get more than one feed displayed.

I did not create this code so i don’t know how i can get the script and the similar code, to get rss from different sites. So basically what i want is to know how i can do this with a vb-script and display it in cmd.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:53:52+00:00Added an answer on June 13, 2026 at 12:53 am

    If you’re only interested in the top headline, you should use “channel/item/title” instead of “channel/item/description”. With many feeds the description is enriched with HTML, so printing the first line of that probably won’t do you any good.

    You could simplify both scripts to something like this:

    Sub PrintTopHeadline(feed)
      Set req = CreateObject("MSXML2.XMLHTTP.3.0")
      req.Open "GET", feed, False
      req.Send
    
      Set xml = CreateObject("Msxml2.DOMDocument")
      xml.loadXml(req.responseText)
      WScript.StdOut.WriteLine xml.getElementsByTagName("channel/item/title")(0).Text
    End Sub
    
    PrintTopHeadline "http://feeds.bbci.co.uk/news/rss.xml"
    PrintTopHeadline "http://news.google.com/news?ned=us&topic=h&output=rss"
    ...
    

    You’d have to call the script with cscript.exe, though, to be able to print commandline output:

    cscript //NoLogo feeds.vbs
    

    Edit: For displaying more headlines from a feed you’d add a loop to PrintTopHeadline(), something like this:

    For i = 0 To 4
      WScript.StdOut.WriteLine xml.getElementsByTagName("channel/item/title")(i).Text
    Next
    

    HTML tags can be removed by something like this:

    descr = xml.getElementsByTagName("channel/item/description")(0).Text
    
    Set re = New RegExp
    re.Pattern = "\s*<.+?>\s*"
    re.Global  = True
    
    descr = Trim(re.Replace(descr, " "))
    

    However, you’d need additional code to convert HTML entities back to plain text, e.g.:

    descr = Replace(descr, "&quot;", """")
    descr = Replace(descr, "&ntilde;", "ñ")
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello there :) Im trying to figure out how i can grab some content
Hello there everyone, I've been trying to figure out how to create a function
Hello I've been trying to figure out generic way to log http requests in
I am trying to migrate over to Python from Matlab and can't figure out
Hello I am trying to figure out how convert / decode a base64 string
hello i'm trying to figure out how to center this image based on my
Possible Duplicate: Detecting IE using jQuery Hello, I'm trying to figure out how to
I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
Hello I´m trying to automate AZURE VM management like Amazon EC2. Is there any
I am trying to figure out how to do the following. I have webpage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.