REVO2700 RSS @ L , 4a RSS with Rev U Lucida Grande U Lucida Grande @U Lucida Grande W Tahoma W Tahoma @U Tahoma U Tahoma U Tahoma AU Tahoma cREVGeometryCache stackID 1039 cREVGeneral debugObjects breakpoints handlerList breakpointstates bookmarks breakpointconditions scripteditorvscroll 0scripteditorselection 0prevHandler tempScript stackfileversion 2.7script AlreadyHidden false P local sWebPage = "http://rss.slashdot.org/Slashdot/slashdot" local sItemPath = "RDF" local sTreeId function itemList local tTreeID, tItems ## Create an xml tree. put itemGetTree() into tTreeID ## 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 # Error end if ## Return a list of all the child nodes. return tItems end itemList # # Creates an xml tree. # private function itemGetTree if sTreeId is not empty then ## A tree has already been built. return sTreeId end if local tWebPage, tTreeID ## Retrieve the page containing the RSS feed. put url sWebPage into tWebPage ## Create xml tree in memory put revCreateXMLTree(tWebPage, false, true, false) into tTreeID ## revCreateXMLTree returns a positive integer if the tree has been ## made successfully. if tTreeID is not a number then put "ERROR: Tree not made" exit itemGetTree end if put tTreeID into sTreeId ## Return the id of the xml tree in memory. return sTreeId end itemGetTree # # Builds up the html text which will be displayed in the field on the stack. # 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 "
" after tHtml put "" & tItem["pubDate"] & "
" after tHtml end repeat if tHtml is not empty then set the htmlText of field "Articles" to tHtml end if end createRssArticles # # Gets all the required details about each item in the RSS feed. # function itemGet pItem local tTreeID put itemGetTree() into tTreeID local tItemPath ## Create a path to the current child. put sItemPath & slash & pItem into tItemPath local tItem ## Get the 'title' node of the child. get revXMLNodeContents(tTreeID, tItemPath & "/title") if item 1 of it is "xmlerr" then return empty end if ## Put the title into an array. put it into tItem["title"] ## Get the 'link' node of the child. get revXMLNodeContents(tTreeID, tItemPath & "/link") if item 1 of it is "xmlerr" then return empty end if ## Put the link into an array. put it into tItem["link"] ## Get the 'date' node of the child. get revXMLNodeContents(tTreeID, tItemPath & "/date") if item 1 of it is "xmlerr" then return empty end if ## Put the publication date into an array. put it into tItem["pubDate"] ## Return array containing all required details for the current child. return tItem end itemGet # # Deletes the XML tree that was created in memory # command deleteXMLTree ## Delete the XML tree from memory revDeleteXMLTree sTreeID ## Put empty into the variable storing the tree id put empty into sTreeId end deleteXMLTree on preOpenCard ## Clear the list of articles put empty into field "Articles" end preOpenCard cREVGeometryCacheIDs 1204644342442 10341204643890903 10321203702410932 10061204643725539 60001284455756543 10371204562571776 10121204644491038 6001 cREVGeometrycache order total 7 cREVGeneral scriptChecksum jH~\@handlerList 6mouseUp itemList itemGetTree createRssArticles itemGetbreakPoints scriptSelection char 450 to 449scripteditorvscroll 0 bookmarks scripteditorselection 579prevHandler createRssArticlestempScript script *Vlocal sWebPage = "http://rss.slashdot.org/Slashdot/slashdot"
local sItemPath = "rdf/"
local sTreeId
on mouseUp
if the short name of the target is "Get" then
local tItems, tItem
put empty into field "Articles"
-- Get a list of the items contained in the RSS feeds.
put itemList() into tItems
createRssArticles tItems
-- You must delete any XML trees which you create in memory as they are not deleted
-- automatically.
revDeleteXMLTree sTreeId
put empty into sTreeId
end if
end mouseUp
function itemList
local tTreeID, tItems
-- Create an xml tree.
put itemGetTree() into tTreeID
-- 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 "revxmlerr" then
# Error
end if
-- Return a list of all the child nodes.
return tItems
end itemList
#
# Creates an xml tree.
#
private function itemGetTree
if sTreeId is not empty then
-- A tree has already been built.
return sTreeId
end if
local tWebPage, tTreeID
-- Retrieve the page containing the RSS feed.
put url sWebPage into tWebPage
-- Create xml tree
put revCreateXMLTree(tWebPage, false, true, false) into tTreeID
-- revCreateXMLTree returns a positive integer if the tree has been
-- made successfully.
if tTreeID is not a number then
put "ERROR: Tree not made"
exit itemGetTree
end if
put tTreeID into sTreeId
-- Return the id of the xml tree in memory.
return sTreeId
end itemGetTree
#
# Builds up the html text which will be displayed in the field on the stack.
#
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
#
# Gets all the required details about each item in the RSS feed.
#
function itemGet pItem
local tTreeID
put itemGetTree() into tTreeID
local tItemPath
-- Create a path to the current child.
put sItemPath & slash & pItem into tItemPath
local tItem
-- Get the 'title' node of the child.
get revXMLNodeContents(tTreeID, tItemPath & "/title")
if item 1 of it is "revxmlerr" then
return empty
end if
-- Put the title into an array.
put it into tItem["title"]
-- Get the 'link' node of the child.
get revXMLNodeContents(tTreeID, tItemPath & "/link")
if item 1 of it is "revxmlerr" then
return empty
end if
-- Put the link into an array.
put it into tItem["link"]
-- Get the 'date' node of the child.
get revXMLNodeContents(tTreeID, tItemPath & "/date")
if item 1 of it is "revxmlerr" then
return empty
end if
-- Put the publication date into an array.
put it into tItem["pubDate"]
-- Return array containing all required details for the current child.
return tItem
end itemGet
p q Articles p 7on linkClicked pLink revGoUrl pLink end linkClicked @ < cREVTable currentview cREVGeneral scriptChecksum xg-"ů bookmarks revUniqueID 1203702410932handlerList linkClickedscriptSelection char 24 to 23prevHandler linkClickedtempScript scripton linkClicked pLink
revGoUrl pLink
end linkClicked
3In Indonesia, a Winner For Now In the Browser Wars nhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/wMAUH8vSgYU/In-Indonesia-a-Winner-For-Now-In-the-Browser-Wars 2 2011-05-09T09:03:00+00:00 4Australian Tax Office Seeks Keylogger To Combat RSI phttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/FqV3yXOVaF0/Australian-Tax-Office-Seeks-Keylogger-To-Combat-RSI 3 2011-05-09T05:55:00+00:00 .Bin Laden Hideout Recreated In Counter-Strike jhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/uiLqht1lVng/Bin-Laden-Hideout-Recreated-In-Counter-Strike - 2011-05-09T02:47:00+00:00 5File-hosting Sites Not a Safe Haven For Private Data qhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/hkXRqypaJas/File-hosting-Sites-Not-a-Safe-Haven-For-Private-Data 4 2011-05-08T23:46:00+00:00 (Kepler May Uncover Numerous Ring Worlds dhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/0L8f_UIbZcU/Kepler-May-Uncover-Numerous-Ring-Worlds ' 2011-05-08T22:34:00+00:00 -Sony Delays PlayStation Network Reactivation ihttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/47a_oFMD7X8/Sony-Delays-PlayStation-Network-Reactivation , 2011-05-08T21:15:00+00:00 /Marking 125 Years Since the Great Gauge Change khttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/zaGPgkc1TWg/Marking-125-Years-Since-the-Great-Gauge-Change . 2011-05-08T20:06:00+00:00 9Peugeot EX1 Sets Electric Car Lap Record At Nuerburgring uhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/ad5h7IOZJgU/Peugeot-EX1-Sets-Electric-Car-Lap-Record-At-Nuerburgring 8 2011-05-08T18:54:00+00:00 >Ask Slashdot: Alternatives To Tor Browser Bundle For Windows? xhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/d3Ohofls2Ao/Ask-Slashdot-Alternatives-To-Tor-Browser-Bundle-For-Windows = 2011-05-08T17:50:00+00:00 3Easily Distracted People May Have 'Too Much Brain' mhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/iNfzpRS5wTY/Easily-Distracted-People-May-Have-Too-Much-Brain 2 2011-05-08T16:42:00+00:00 2 RMS Books Hit Version 2.0 Whttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/6ciVOe30FGU/2-RMS-Books-Hit-Version-20 2011-05-08T15:40:00+00:00 3Groupon Deal Costs Photographer a Year's Free Work nhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/hHaeX-eUqgQ/Groupon-Deal-Costs-Photographer-a-Years-Free-Work 2 2011-05-08T14:34:00+00:00 8Making Wireless, Not Ethernet, the Heart of the Network rhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/u3eGVJ9xkDA/Making-Wireless-Not-Ethernet-the-Heart-of-the-Network 7 2011-05-08T13:28:00+00:00 8Idle: Four Injured In iPad Fight At Beijing Apple Store shttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/pTp3vzgG6-c/Idle-Four-Injured-In-iPad-Fight-At-Beijing-Apple-Store 7 2011-05-08T12:38:00+00:00 Why the New Guy Can't Code Vhttp://rss.slashdot.org/~r/Slashdot/slashdot/~3/Px1UiK__MzY/Why-the-New-Guy-Cant-Code 2011-05-08T12:13:00+00:00 ` @ = Rectangle K@ ""dd 8 cREVGeneral revUniqueID 1204562571776 p normal.png 2 a ! &PNG IHDR a ! ^ gAMA OX2 tEXtSoftware Adobe ImageReadyqe<