Rorssparser, rorssarticle (hd2000 only) – BrightSign HD2000 Object Reference Manual User Manual
Page 53

roRssParser, roRssArticle (HD2000 only)
roRssParser and roRssArticle class are used to display an RSS ticker on the screen.
roRssParser is created with no parameters:
CreateObject("roRssParser")
The roRssParser interface provides:
rotBOOL ParseFile(rotSTRING filename)
o
Parse an RSS feed from a file.
rotBOOL ParseString(rotSTRING filename)
o
Parse an RSS feed from a string.
rotObject GetNextArticle(rotVOID)
o
Get the next article parsed by the RSS parser. The articles are sorted in publication date order
with the most recent article first. This returns an roRssArticle object if there is one, otherwise
an rotINT32 is returned.
The roRssArticle interface provides:
rotSTRING GetTitle(rotVOID)
o
The title of the RSS item.
rotSTRING GetDescription(rotVOID)
o
The content of the RSS item.
rotSTRING GetDescription(rotVOID)
o
Returns the difference in seconds for the publication date between this RSS item and the most
recent item in the feed. This can be used by the user to decide that an article is too old to
display.
Example:
u=CreateObject("roUrlTransfer")
u.SetUrl("
")
u.GetToFile("tmp:/rss.xml")
r=CreateObject("roRssParser")
r.ParseFile("tmp:/rss.xml")
EnableZoneSupport(1)
b=CreateObject("roRectangle", 0, 668, 1024, 100)
t=CreateObject("roTextWidget", b, 3, 2, 2)
t.SetForegroundColor(&hD0D0D0)
t.Show()
article_loop:
a = r.GetNextArticle()
if type(a) = "roRssArticle" then
t.PushString(a.GetDescription())
goto article_loop
endif
loop:
sleep(1000)
goto article_loop
53