I have the following code that collects all information from a RSS feed, and takes out the information I need:
$(xml).find('item').each(function() {
var stage = $(this).attr('p4:stage');
var title = $(this).find('title').text();
var desc = $(this).find('description').text();
var location = $(this).find('category').eq[0];
var billtype = $(this).find('category').eq[1];
var linkurl = $(this).find('link').text();
var thedate = $(this).find('a10\\:updated,updated').text();
thedate = thedate.substring(0,10);
info.push({'stage': stage},{'title': title},{'description': desc},{'location': location},{'billtype': billtype},{'linkurl': linkurl},{'thedate':thedate});
});
console.log(info);
But when I look at what is being sent, its not 1 object with 5 children, each child representing a <item>....contents.....</item>, but one object with over 200 children, each one containing one part of the <item></item>, such as:
[0 … 99]
0: Object
stage: "Committee stage"
__proto__: Object
1: Object
title: "Mesothelioma"
__proto__: Object
2: Object
description: "A Bill to establish a diffuse mesothelioma payments scheme and make related provision, and to make provision about the resolution of certain insurance disputes."
__proto__: Object
Could someone help with the code, so I can get whatever number of rss feed items and it's contents to be a child ?
Thanks in advance
info.push({'stage': stage,'title': title,'description': desc,'location': location,'billtype': billtype,'linkurl': linkurl,'thedate':thedate});