1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
/* ***************************************************************************** */ /* Example of a syndication feed reader using the Project Rome API with */ /* BSF4ooRexx */ /* current version (2009) of Rome: rome1.0.jar https://rome.dev.java.net/ */ /* You need to implement this API plus the JDOM API */ /* jdom.jar, you can find this at https://jdom.org/ */ /* This class retrieves a syndfeed from the web and prints some */ /* information about the feed using */ /* "com.sun.syndication.io.SyndFeedInput" methods */ /* created by Martin Stoppacher date: 26.12.2009 */ /* ***************************************************************************** */ say hello this reads a syndfeed --say please type in the url /* possible input statement for the feed URL */ --pull url --parse arg url /* optional input via arguments */ /* The url String is predefined in this example, to change the feed url */ /* replace to String in this file or use one of the above methods */ url= "http://rss.orf.at/fm4.xml" feedUrl=.bsf~new("java.net.URL", url) /* create an instance of java.net.URL */ say connecting__ || feedUrl~getAuthority() input=.bsf~new("com.sun.syndication.io.SyndFeedInput")/* creates a SyndFeedInput */ xmlr=.bsf~new("com.sun.syndication.io.XmlReader", feedUrl) /* Figures out the charset encoding of the XML document within the stream */ feed= input~build(xmlr) /* Builds a SyndFeedImpl from an Reader , also possible with SAX or DOM */ say bb~getDefaultEncoding() say feed /* returns the feed object */ ::requires BSF.cls /* get the Java support */ |