beautypg.com

BrightSign BrightScript 2 Reference Guide User Manual

Page 17

background image

17

Will return an roXMLElement reference to the first photo (id="3131875696”).

? rsp.photos
Will return an roXMLList reference containing the photos tag.

rsp.photos@perpage


Will return the string 100.

Use the Text() method to return an element‟s text.

For example, if the variable booklist contains this roXMLElement:


The Dawn of Man

Print booklist.book.gettext()


Will print “The Dawn of Man”.

print booklist.book@lang


Will print “eng”.

example flikr code clip

REM
REM Interestingness
REM pass an (optional) page of value 1 - 5 to get 100 photos
REM starting at 0/100/200/300/400
REM
REM returns a list of "Interestingness" photos with 100 entries
REM

Function GetInterestingnessPhotoList(http as Object, page=1 As Integer) As
Object

print "page=";page



http.SetUrl("http://api.flickr.com/services/rest/?method=flickr.interestingness
.getList&api_key=YOURKEYGOESHERE&page="+mid(stri(page),2))

xml=http.GetToString()

rsp=CreateObject("roXMLElement")
if not rsp.Parse(xml) then stop

return helperPhotoListFromXML(http, rsp.photos.photo)

'rsp.GetBody().Peek().GetBody())

End Function

Function helperPhotoListFromXML(http As Object, xmllist As Object,