RSS feed with google news
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
RSS feed with google news
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
As with other people it is not displaying. I have tried changing "RDF" to " "rss/channel". It didn't work!
Thanks
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: RSS feed with google news
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: RSS feed with google news
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.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: RSS feed with google news
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: RSS feed with google news
Sure. There was a piece of the code with the comment "//Error", I've changed and am getting an error there.
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 :/## 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
Re: RSS feed with google news
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
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
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: RSS feed with google news
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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: RSS feed with google news
<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
I was testing also. I removed the published date and that made it worked! Minus the date obviously