472,781 Members | 1,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,781 software developers and data experts.

Help returning the correct item from an RSS feed that has Attributes


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
  1. 'i.ToString is the index of the current Item being parsed
  2. xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
parsing from...
Expand|Select|Wrap|Line Numbers
  1. <item>
  2.     <title>Super.Awesome.Movie.2012.DBRip</title>
  3.     <guid isPermaLink="false">77428c576538422</guid>
  4.     <link>Long Long Link :)</link>
  5.     <comments>Some_Link#comments</comments>     
  6.     <pubDate>Mon, 16 Jul 2012 21:51:33 +0000</pubDate> 
  7.     <category>Movies</category>     
  8.     <description>Totally awesome flick!!!  lol</description>
  9.     <enclosure url="http://LongURL" length="14174679056" type="application/x-nzb" />
  11.     <newznab:attr name="category" value="2000" />
  12.     <newznab:attr name="category" value="2060" />
  13.     <newznab:attr name="size" value="14174679056" />
  14.     <newznab:attr name="files" value="102" />
  15.     <newznab:attr name="poster" value="hihi &lt;hihi@kere.ws&gt;" />
  16.     <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
  17.     <newznab:attr name="grabs" value="2" />
  18.     <newznab:attr name="comments" value="0" />
  19.     <newznab:attr name="password" value="0" />
  20.     <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />    
  21.     <newznab:attr name="group" value="alt.binaries.mom" />
  23. </item>
That does the job IF the number of properties are constant for each Item block in the RSS thingy.

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
  1.     <newznab:attr name="category" value="2000" />
  2.     <newznab:attr name="category" value="2060" />
  3.     <newznab:attr name="size" value="14174679056" />
  4.     <newznab:attr name="files" value="102" />
  5.     <newznab:attr name="poster" value="hihi &lt;hihi@kere.ws&gt;" />
  6.     <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
  7.     <newznab:attr name="grabs" value="2" />
  8.     <newznab:attr name="comments" value="0" />
  9.     <newznab:attr name="password" value="0" />
  10.     <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />    
  11.     <newznab:attr name="group" value="alt.binaries.mom" />
The entry with usenetdate is what I need to get at no matter where it is in the list... I say this because the way I'm doing it now works until an extra entry is entered, or removed from one of the Items in the feed, & throws the index position off for every Item in the feed. So... the following no longer works because of it:
Expand|Select|Wrap|Line Numbers
  1. 'i.ToString is the index of the current Item being parsed
  2. xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
I don't know what to search for in Google, or what element/format/or whatever I'm talking about is, or is called. No clue about format, or whatever.

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
  1. xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr[2]@value")
Expand|Select|Wrap|Line Numbers
  1. xSize = Rsss1.GetProperty("item[" & i.ToString & "]/newznab:attr/name:size@value")
  2. (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
  2. <item>
  3.         <newznab:attr name="category" value="2000" />
  4.         <newznab:attr name="category" value="2060" />
  5.         <newznab:attr name="size" value="14174679056" />
  6.         <newznab:attr name="files" value="102" />
  7.         <newznab:attr name="poster" value="hihi &lt;hihi@kere.ws&gt;" />
  8.         <newznab:attr name="genre" value="Crime|Drama|Mystery|Thriller" />
  9.         <newznab:attr name="grabs" value="2" />
  10.         <newznab:attr name="comments" value="0" />
  11.         <newznab:attr name="password" value="0" />
  12.         <newznab:attr name="usenetdate" value="Mon, 16 Jul 2012 21:49:50 +0000" />    
  13.         <newznab:attr name="group" value="alt.binaries.mom" />
  16. </item>
I currently use the following to get the info:
Expand|Select|Wrap|Line Numbers
  1. xDate = Rsss1.GetProperty("item[9]/newznab:attr[11]@value")
...but I need another way that doesn't use [11], because the index will not be the same for the next item block.

I have tried:
Expand|Select|Wrap|Line Numbers
  1. xDate = Rsss1.GetProperty("item[9]/newznab:attr[@name='usenetdate']@value")
...but that doesnt work either. Please help.

Thanks guys.
Jul 17 '12 #1
0 1467

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Funnyweb | last post by:
I have just notices that the date() function is not returning the correct date/time on my "server". I am running apache2 on my winxp pro laptop. My system clock is set to the correct date,...
by: i. dzhugashvili | last post by:
I'm hoping someone can help me here. I'm having problems using a function to get the search criteria for a column in the QBE grid. The column's data type is Long and the problem is that if I...
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
by: Earl T | last post by:
When I try to get the netscape version for version 7, I get the HttpBrowserCapabilities class returning the version as 5 and not 7. (see code and output below) CODE HttpBrowserCapabilities...
by: Carlo Marchesoni | last post by:
I'm going crazy with this. I just added two Listboxes (lbxSource->multiple selection and lbxDestination -> single selection). Then: a) button "Load": ListItem l0 = new ListItem("01");...
by: Brian Mitchell | last post by:
I'm sure this is a very dumb question but when a user clicks on a row in my data table (which has been sorted) how do I return the correct row index for my underlying data table? The...
by: banjolibrarian | last post by:
I have been setting up RSS and Atom feeds for our library's podcasts. The RSS feed works fine, but when I subscribe to the Atom feed (via Bloglines), the link to the file itself defaults to...
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
by: starlight849 | last post by:
Hello, I am writing a program that is connection to an oracle database using the tableadapter method. I am populating a drop down list with a distinct set of values. I am then wanting to display...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.