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 )
RSS example breaks with other feeds
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
RSS example breaks with other feeds
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: RSS example breaks with other feeds
Jellicle,
Got a link to that stack?
Mark
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: RSS example breaks with other feeds
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
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
-
- 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
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.
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
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.
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.
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.
Re: RSS example breaks with other feeds
Didn't work for me either.
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: RSS example breaks with other feeds
This basic piece of code works for me.
Got the explanation from http://activethought.net/livecode-server/xml/
See for the complete RSS example with a ticker feed http://forums.livecode.com/viewtopic.php?f=9&t=28703
Regards,
Paul
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
Regards,
Paul