Get a textfile/URL from a server - found no solution here

Hello,

This is my Problem:

There is an API you can call with an URL like this http://intranet.somewhere.com/return?byName=Karsten%20Brusch

This returns all infos about “Karsten Brusch” like phone-nr, email etc.

In a web-browser it returns a filetype “text/html”

and the informations are in a

 -Tag

I have to store these informations in a string to extract them.

I tried to open this URL with the

“Open location For Input Access Read As file1%”

But the debugger returned “Unable to open file” at this statement.

Well, this URL is no physial file. So I think this wouldn’t work.

Any Ideas how to get the informations returned by the API / Webserver?

I’m using Lotus Script and I have a working solution for exacly the same problem in LotusWord Pro. This uses “.RetrieveInternetFile(Location)” but this object method is not available in lotus notes.

Is there a function i can use?

I’m looking forward to use this inside a “While” -Statement; so it is not possible to open the URL in Notes Browser and get the Informations from there. This wouldn’t be performant enought.

Thank you very much

with greetings from Berlin


Subject: Get a textfile/URL from a server - found no solution here

Hi Karsten,the LS Open statement doesn’t support http connections. Looks like you have a case for a small Java Class and the use of LS2J in your Lotus Script. Just make sure the JavaClass returns a String. The Java IO is quite simple, but if you need very sophisticated stuff (login/cookies etc.) you might want to use Apache Jakarta’s HTTPclient.

Greetings from Singapore

:slight_smile: stw

Subject: RE: Get a textfile/URL from a server - found no solution here

Just for kicks, try db.GetDocumentByURL. The actual content should be gettable in one of the CGI fields in the returned NotesDocument object.

Subject: RE: Get a textfile/URL from a server - found no solution here

Hey Stan,

I’m affraid the statement “db.GetDocumentByURL” does not work. That’s what the the Server return to the Notes Request.


The requested document (URL http://bluepages.ibm.com/BpHttpApis/wsapi?allByNotesID=CN=Paul%20Everett/OU=Endicott/O=IBM@IBMUS) could not be accessed.

The remote server either is not accessible or is refusing to serve the document.


I think this tries to open a Notesdatabase-Document. But on the affected Server there is a script running (for sure php) so there Notes is not able to find any Database-Doc.

Thank you,

I’ll post the solution if I find something.

Maybe the JavaScript-Variant is the best.

Greetz

Subject: RE: Get a textfile/URL from a server - found no solution here

No, GetDocumentByURL works just fine. If there’s a problem, look at proxies and so forth. Or look directly at the error message you are receiving – the server refused to serve the document. Once you get it working, assuming there are no authentication issues or accept-type requirements, you will be able to get the content from the Body field of the resulting document.

Subject: RE: Get a textfile/URL from a server - found no solution here

Hello Stephan,

there is no Login needed, so I’ll try your suggestion.


Hey I’ve found it…

There is a solution using Java for our Intranet.

Thanks for this…

Subject: Get a textfile/URL from a server - found no solution here

You can also use this freeware tool, which copies any file from an URL to your harddrive.You could call it from an LS agent: