Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Feedburner

Anyone have any examples of parsing a feedburner RSS feed into a tableview? Thanks

— asked May 24th 2010 by Mark Smillie
  • feedburner
  • rss
0 Comments

2 Answers

  • check out the kitchensink example

    — answered May 25th 2010 by Peter Lum
    permalink
    0 Comments
  • A way is to use a converter xml2json like XMLtools.js from David Bankier. Htttp client retrieves you the xml and the lib converts to object.
    Here an example, how to use

    exports.getLatest = function(_callback) {
        require('offlinealert').create();
        var xhr = Ti.Network.createHTTPClient({
            timeout : 16000,
            onload : function() {
                var XMLTools = require('modules/XMLtools');
                var parser = new XMLTools(this.responseXML);
                var rss = parser.toObject();
                _callback((Object.prototype.toString.call(rss.channel.item) === '[object Array]' ) ? rss.channel.item : [rss.channel.item]);
            },
            onerror : function(e) {
                console.log(e.error);
            }
        });
        xhr.open('GET', 'http://www.podcampus.de/nodes.rss');
        xhr.send();
    }
    
    — answered February 17th 2013 by Rainer Schleevoigt
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.