GoingForGold
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 11/22/2011
-
Status: offline
|
Retrieve RSS Feed
Tuesday, November 22, 2011 9:57 AM
( permalink)
Hello all together! I have been searching the internet and trying various things all day but nothing worked so far. I hope you can help me :) My goal is to retrieve an RSS Feed (an XML file located in the world wide web) and find all the "title" fields and put them together in one string variable (in a .vbs document). I tried several things, including jsrssv.ops, nothing worked, not even the testscripts ;). I would be very happy if you could give me some help for this project! Thank you!
|
|
|
|
59cobalt
-
Total Posts
:
979
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: offline
|
Re:Retrieve RSS Feed
Tuesday, November 22, 2011 12:01 PM
( permalink)
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
Re:Retrieve RSS Feed
Tuesday, November 22, 2011 2:31 PM
( permalink)
GoingForGold Hello all together! I have been searching the internet and trying various things all day but nothing worked so far. I hope you can help me :) My goal is to retrieve an RSS Feed (an XML file located in the world wide web) and find all the "title" fields and put them together in one string variable (in a .vbs document). I tried several things, including jsrssv.ops, nothing worked, not even the testscripts ;). I would be very happy if you could give me some help for this project! Thank you! Dim titles : titles = ""
Dim xml : Set xml = CreateObject("MsXml2.DomDocument.6.0")
With xml
.async = False
.load("http://www.visualbasicscript.com/rss-m95005.ashx")
Dim node
For Each node In .selectNodes("//title")
titles = titles & ";" & node.text
Next
End With
MsgBox titles
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
GoingForGold
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 11/22/2011
-
Status: offline
|
Re:Retrieve RSS Feed
Tuesday, November 22, 2011 10:27 PM
( permalink)
Thank you for your ideas, and thank you for this snippet TNO. I tried something in this direction which didn't work, but now i tried your code. Well, are you sure with these ":"? I have never seen this thing in a .vbs code and I also get an error message because of these ":".
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
Re:Retrieve RSS Feed
Wednesday, November 23, 2011 3:37 AM
( permalink)
GoingForGold Thank you for your ideas, and thank you for this snippet TNO. I tried something in this direction which didn't work, but now i tried your code. Well, are you sure with these ":"? I have never seen this thing in a .vbs code and I also get an error message because of these ":". You know you can do the following: Dim foo foo = "bar" The ":" symbol is used so you can simply put them on the same line: Dim foo : foo = "bar" If you are getting an error then something else is going on. What error message are you getting?
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
GoingForGold
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 11/22/2011
-
Status: offline
|
Re:Retrieve RSS Feed
Wednesday, November 23, 2011 4:09 AM
( permalink)
Well i have a german OS so I'm not sure if an english OS will translate it the same as me ;) row: 1 character: 13 error: invalid character Edit: Like you, i found this a little strange. i wrote your script new (probably some character messed up) and now it works. perfect, thank you! Edit2: i have never worked with "With" functions. is there a decent way to just "loop" it say 5 times?
<message edited by GoingForGold on Wednesday, November 23, 2011 4:36 AM>
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
Re:Retrieve RSS Feed
Wednesday, November 23, 2011 5:36 AM
( permalink)
GoingForGold Edit2: i have never worked with "With" functions. is there a decent way to just "loop" it say 5 times? In other words you just want the first 5 entries instead of all of the entries? There is no need to use a loop for this as XPath has something like this built in: .selectNodes("//title[ position() <= 5]")
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|