Page 1 of 1

RSS feed with google news

Posted: Wed Jun 10, 2015 6:38 pm
by Euant98
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

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 6:45 pm
by FourthWorld
What does "didn't work" mean? The data didn't download? Wasn't formatted correctly? Something else?

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 7:22 pm
by Euant98
It didn't display. I can't tell what the exact problem. I'm not good enough with this code to identify the problem.

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 7:26 pm
by FourthWorld
Can you share that part of your code so we can see what's going on?

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 7:32 pm
by Euant98
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 :/

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 8:05 pm
by Euant98
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

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 8:20 pm
by FourthWorld
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.

Re: RSS feed with google news

Posted: Wed Jun 10, 2015 8:54 pm
by Euant98
<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