English 中文(简体)
Reading a remote URL in Domino LotusScript
原标题:

I have a remote RSS feed which has to be transformed into Notes documents using LotusScript.

I ve looked through the documentation, but I can t find how to open a remote URL in order to retrieve its contents. In other words, some sort of wget- or curl-like functionality. Can anyone shed some light on how to do this? Using Java is not an option.

Thanks.

最佳回答

Check out the NotesDOMParser class - available in LotusScript - which lets you (indirectly) pull XML from a remote URL and process in a an XML DOM object.

You can pull the XML into a string using the MSXMLHTTP COM object, then use NotesStream to send the XML to the NotesDOMParser.

I have not tested, but the code would look something like this:

...
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", sURL, False, "", ""
objXML.send("")
sXMLAsText = Trim$(objXML.responseText)

Set inputStream = session.CreateStream
inputStream.Open (sXMLAsText)
Set domParser=session.CreateDOMParser(inputStream, outputStream)
domParser.Process
...

Documentation: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESDOMPARSER_CLASS.html

问题回答

You can t open a remote URL (whether it s HTTP or some other protocol) using native Lotusscript: the object library simply doesn t support it. If you re running on a Windows server, you should be able to use the MS XMLHttp DLLs to get a handle on your remote file via a URL, as specified by the previous answer. (Alternatively, this link specifies how to parse and open a UNC path with Lotusscript—again, Windows only).

All that said, if I understand you correctly, you re not using HTTP to access the remote file at all. If the RSS file is just on a simple path, why can t you open the file for parsing in the normal way with Lotusscript?





相关问题
Can we access orkut using RSS?

Is it possible to access orkut (features of orkut such as scraps, friend find, etc.) through RSS? We can access facebook using RSS. Does orkut provides similar facility?

WordPress RSS feed validation error

I ve installed WordPress successfully but experiencing a RSS feed error. I ve tried to edit files within the WordPress like wp-rss2.php so as to remove the ? from the first line but it does not ...

How can I generate RSS with arbitrary tags and enclosures

Right now, I m using PyRSS2Gen to generate an RSS document (resyndicating a modification of an rss feed that was parsed with feedparser), but I can t figure out how to add uncommon tags to the item. ...

Is it exists any "rss hosting" with API for creating feeds

I am creating a desktop app that will create some reports. I want to export these reports as RSS or ATOM feeds. I can easily create feeds with Rome lib for Java. But I have no idea how to spread them. ...

Converting RSS feed to Atom via Feedburner for existing blog

I have an RSS based blog that I now want to convert to Atom. Feedburner can change the output format in one click. Will my existing subscribers notice any change on the reader side? (other than ...

热门标签