RSS feed with google news

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Euant98
Posts: 6
Joined: Wed Jun 10, 2015 6:34 pm

RSS feed with google news

Post by Euant98 » Wed Jun 10, 2015 6:38 pm

Trying to create a RRS feed with google news. I'm using the example from the RSS lesson.
As with other people it is not displaying. I have tried changing "RDF" to " "rss/channel". It didn't work!

Thanks

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: RSS feed with google news

Post by FourthWorld » Wed Jun 10, 2015 6:45 pm

What does "didn't work" mean? The data didn't download? Wasn't formatted correctly? Something else?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Euant98
Posts: 6
Joined: Wed Jun 10, 2015 6:34 pm

Re: RSS feed with google news

Post by Euant98 » Wed Jun 10, 2015 7:22 pm

It didn't display. I can't tell what the exact problem. I'm not good enough with this code to identify the problem.
Last edited by Euant98 on Wed Jun 10, 2015 7:27 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: RSS feed with google news

Post by FourthWorld » Wed Jun 10, 2015 7:26 pm

Can you share that part of your code so we can see what's going on?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Euant98
Posts: 6
Joined: Wed Jun 10, 2015 6:34 pm

Re: RSS feed with google news

Post by Euant98 » Wed Jun 10, 2015 7:32 pm

Sure. There was a piece of the code with the comment "//Error", I've changed and am getting an error there.
## Get the 'item' child nodes of the xml tree starting from the node represented by sItemPath.
put revXMLChildNames(tTreeID,sItemPath, return, "item", true) into tItems
if item 1 of tItems is "xmlerr" then
answer "Error"
end if
edit I had re downloaded the code and forgot to change local sItemPath ="rss/channel". This error is no longer displaying but it's still not working :/

Euant98
Posts: 6
Joined: Wed Jun 10, 2015 6:34 pm

Re: RSS feed with google news

Post by Euant98 » Wed Jun 10, 2015 8:05 pm

I've done a little testing and it seems its the tHtml that isnt displaying.

command createRssArticles pItems
local tHtml, tItem

## Loops through all the items contained in the RSS feed, adding their data to the html
## text which will be displayed within the field on the stack.
repeat for each line tItemName in pItems
put itemGet(tItemName) into tItem
put "<p><a href=" & quote & tItem["link"] & quote & ">" & tItem["title"] & "</a></p>" after tHtml
put "<p>" & tItem["pubDate"] & "</p><p></p>" after tHtml
end repeat

if tHtml is not empty then
set the htmlText of field "Articles" to tHtml
end if
end createRssArticles

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: RSS feed with google news

Post by FourthWorld » Wed Jun 10, 2015 8:20 pm

Try replacing this:

set the htmlText of field "Articles" to tHtml

...with this:

set the text of field "Articles" to tHtml

...so you can see what the output looks like. Posting it here will be helpful.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Euant98
Posts: 6
Joined: Wed Jun 10, 2015 6:34 pm

Re: RSS feed with google news

Post by Euant98 » Wed Jun 10, 2015 8:54 pm

<p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p><p><a href=""></a></p><p></p><p></p>

I was testing also. I removed the published date and that made it worked! Minus the date obviously

Post Reply