RSS example breaks with other feeds

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

RSS example breaks with other feeds

Post by Jellicle » Fri Feb 25, 2011 7:19 am

The RSS example stack on the support pages uses a slashdot feed; I'm getting errors with all other feeds I've tried. Is the example stack hard-wired for that feed?

(BTW I'm brand new to working with RSS/XML. Go easy on me :))
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: RSS example breaks with other feeds

Post by Mark » Sun May 15, 2011 12:07 am

Jellicle,

Got a link to that stack?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

brains
Posts: 1
Joined: Mon Jun 27, 2011 12:51 am

Re: RSS example breaks with other feeds

Post by brains » Mon Jun 27, 2011 1:05 am

I also need some help on this.

I have downloaded the stack available on this page: (sorry...for some reason I can't post web links!!!...but it is lesson 19173-Intermediate-RSS-Feeds

I have changed the RSS feed located at the top of the card script and tried it with a BBC feed but no feed appears.

I think it has something to do with the feed format etc and this: revXMLChildNames(tTreeID, "RDF", return, "item", true)

BUT, as a complete noob I could be looking in the wrong direction.

Any help would be appreciated (remember...new to LiveCode)

Many thanks

DRJ-UK
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 73
Joined: Tue Aug 23, 2011 2:50 pm
Location: United Kingdom
Contact:

Re: RSS example breaks with other feeds

Post by DRJ-UK » Fri Aug 26, 2011 9:28 am

Just discovered this post.

We had the same problem earlier this year with the tutorial. Delving into the XML feed format for the RSS content was the key for us. The solution proved straightforward in the end - replacing the "RDF" parameter in revXMLChildNames(tTreeID, "RDF", return, "item", true) with "rss/channel".

This will give revXMLChildNames(tTreeID, "rss/channel", return, "item", true) so will happily read through RSS feeds such as those from the BBC. :D

It would be useful if the tutorial had made some reference to different RSS formats to assist the unwary!

Hope this is helpful and proves worthwhile.

Dave
LiveCode: Versions 8.0, 8.1
Xcode: Version 7.3, 8.0
Mac OS X: 10.11.12 (macOS Sierra) on iMacs with 3.4 Intel Core i7 & 16GB Memory

Creating Apps for educational professionals, effective teaching and learning.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: RSS example breaks with other feeds

Post by bbhank » Tue Apr 26, 2016 9:06 pm

Didn't work for me either. :(

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: RSS example breaks with other feeds

Post by mrcoollion » Tue Jan 24, 2017 7:30 pm

This basic piece of code works for me.
Got the explanation from http://activethought.net/livecode-server/xml/

Code: Select all

on mouseUp
    get url "http://www.nu.nl/rss/Algemeen" // Put here your URL
    put it into myXML
    put revCreateXMLTree(myXML, false, true, false) into tTree
    if tTree is not an integer then
        answer "Error with revCreateXMLTree !"
        exit mouseUp
    end if
    --
    // we can directly access nodes
    put revXMLNodeContents(tTree, "rss/channel/title") && "-" && revXMLNodeContents(tTree, "rss/channel/description") into tTitleAndDescr -- this will out put sites title and description
    put tTitleAndDescr & " .... " into RSSText
    --
    put revXMLChildNames(tTree, "rss/channel/", return, "item", true) into recentPosts
    repeat for each line aPost in recentPosts
        put revXMLNodeContents(tTree, "rss/channel/" & aPost & "/title") into postTitle
        put revXMLNodeContents(tTree, "rss/channel/" & aPost & "/link") into postLink
        put postTitle & " .... " after RSSText
    end repeat
    --
    answer RSSText
end mouseUp
See for the complete RSS example with a ticker feed http://forums.livecode.com/viewtopic.php?f=9&t=28703

Regards,

Paul

Post Reply

Return to “Internet”