I'm trying to parse data from an RSS feed, but ever since they added attributes with more than one thingy in the line that i'm trying to parse, I've been stumped.
I mean I figured it out to this point:
Expand|Select|Wrap|Line Numbers
- 'i.ToString is the index of the current Item being parsed
- xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
Expand|Select|Wrap|Line Numbers
- <item>
- <title>Super.Awesome.Movie.2012.DBRip</title>
- <guid isPermaLink="false">77428c576538422</guid>
- <link>Long Long Link :)</link>
- <comments>Some_Link#comments</comments>
- <pubDate>Mon, 16 Jul 2012 21:51:33 +0000</pubDate>
- <category>Movies</category>
- <description>Totally awesome flick!!! lol</description>
- <enclosure url="http://LongURL" length="14174679056" type="application/x-nzb" />
- <newznab:attr name="category" value="2000" />
- <newznab:attr name="category" value="2060" />
- <newznab:attr name="size" value="14174679056" />
- <newznab:attr name="files" value="102" />
- <newznab:attr name="poster" value="hihi <hihi@kere.ws>" />
- <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
- <newznab:attr name="grabs" value="2" />
- <newznab:attr name="comments" value="0" />
- <newznab:attr name="password" value="0" />
- <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />
- <newznab:attr name="group" value="alt.binaries.mom" />
- </item>
What I want to do is be able to grab... let's say, Mon, 16 Jul 2012 21:49:50 +0000 from:
Expand|Select|Wrap|Line Numbers
- <newznab:attr name="category" value="2000" />
- <newznab:attr name="category" value="2060" />
- <newznab:attr name="size" value="14174679056" />
- <newznab:attr name="files" value="102" />
- <newznab:attr name="poster" value="hihi <hihi@kere.ws>" />
- <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
- <newznab:attr name="grabs" value="2" />
- <newznab:attr name="comments" value="0" />
- <newznab:attr name="password" value="0" />
- <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />
- <newznab:attr name="group" value="alt.binaries.mom" />
Expand|Select|Wrap|Line Numbers
- 'i.ToString is the index of the current Item being parsed
- xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
Please point your flashlights on this situation for me. I need to be slapped in the right direction because I'm lost right now. :)
Just show me a format, or something that i can replace what I have right now with... like from:
Expand|Select|Wrap|Line Numbers
- xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
Expand|Select|Wrap|Line Numbers
- xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr/name:size@value")
- (I haven't got the slightest clue about how to give an example of what to change it to! lol)
ps: The component I'm using (Rsss1) is a paid component from nSoftware.com IPWorks SSL V8 (.NET Edition) that accepts XPath?, or whatever else... it just works with whatever I put into the GetProperty part of it. I just don't know how to deal with atributes in the above format of the feed to know what to enter next.
All help will be greatly appreciated.
#################################
Ok... this is the longest I've ever waited for an answer on Bytes.com... let me try to ask a different way.
I would like to get the contents of "value" where "name" is equal to "usenetdate"... but without using indexes, because the index will not be the same for each item block of the RSS feed.
Expand|Select|Wrap|Line Numbers
- <item>
- <newznab:attr name="category" value="2000" />
- <newznab:attr name="category" value="2060" />
- <newznab:attr name="size" value="14174679056" />
- <newznab:attr name="files" value="102" />
- <newznab:attr name="poster" value="hihi <hihi@kere.ws>" />
- <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
- <newznab:attr name="grabs" value="2" />
- <newznab:attr name="comments" value="0" />
- <newznab:attr name="password" value="0" />
- <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />
- <newznab:attr name="group" value="alt.binaries.mom" />
- </item>
Expand|Select|Wrap|Line Numbers
- xDate = Rsss1.GetProperty("item[9]/newznab:attr[11]@value")
I have tried:
Expand|Select|Wrap|Line Numbers
- xDate = Rsss1.GetProperty("item[9]/newznab:attr[@name='usenetdate']@value")
Thanks guys.