I have this script and I want it to read three headlines from the google science and tech rss feed from news.google.com
it reads the titles of the article fine but the description is all messed up with html code all over it and I'm wondering if any of you might be up looking it over and helping me out. Thanks!
it reads the titles of the article fine but the description is all messed up with html code all over it and I'm wondering if any of you might be up looking it over and helping me out. Thanks!
Code:
property RSSURL : "http://news.google.com/news?ned=us&topic=t&output=rss"
property RSSFile : POSIX path of ((path to temporary items as Unicode text) & "rss.xml")
tell application "System Events"
activate
try
do shell script "curl -sS " & quoted form of RSSURL & " > " & quoted form of RSSFile
set rssFeed to XML file RSSFile
set rssItems to XML elements 1 thru 3 of XML element "channel" of XML element "rss" of contents of rssFeed whose name is "item"
get value of XML element "title" of XML element "channel" of XML element "rss" of contents of rssFeed
display dialog "These are today's top news headlines from " & result
delay 2
on error errorMsg number errorNum
display alert "Error " & errorNum message errorMsg buttons "Cancel" default button 1
return false
end try
repeat with thisItem in rssItems
try
display dialog (get value of XML element "title" of thisItem)
on error
display dialog "No title for this item."
end try
delay 1
try
display dialog (get value of XML element "description" of thisItem)
on error
display dialog "No description for this item."
end try
delay 2
end repeat
display dialog "End of headlines."
end tell