Using Conga to get text files?

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Using Conga to get text files?

Postby Budgie on Sat Oct 23, 2010 5:20 pm

I want to get hold of the data out of some plain text files which are normally accessed by web browser. These files do not contain any HTML code, and Conga's HTTPGet function returns "404 page not found".

For an idea of what I'm trying to do, a specimen url is http://www.leyland.vispa.com/numth/fact ... bn/9+7.txt

There are far too many "web pages" like this out there, and I don't want to have to download them manually every time. Can anyone suggest a way of using Conga to get hold of this data?

Thanks.
Jane
User avatar
Budgie
 
Posts: 36
Joined: Thu Nov 26, 2009 9:22 am
Location: Beckenham

Re: Using Conga to get text files?

Postby kai on Mon Oct 25, 2010 9:29 am

Your problem is not related to the file type or extension. Any file will be delivered by Conga.

When you get a 404 the URL is wrong.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: Using Conga to get text files?

Postby kai on Mon Oct 25, 2010 9:38 am

Sorry, pressed "Submit" accidentally.

That's what I thought when I read your message.

Trying the URL in a browser results in the data you are obviously looking for. Trying the same thing with Conga leads to a 404. Interesting. Dyalog should look into this.

Using a .NET solution:
http://aplwiki.com/GetViaHttp
works fine.

Kai
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: Using Conga to get text files?

Postby AndyS|Dyalog on Mon Oct 25, 2010 11:35 am

Hi Jane

I had very similar problems myself last week .. my solution was to amend Samples.HTTPGet so that the command sent to the server was

      'GET ',page,' HTTP/1.1',NL,'Host: ',host,NL,'Accept: */*',NL,NL

rather than

      'GET ',page,' HTTP/1.1',NL,'Host: ',host,':',⍕port,auth,NL,NL

It seems that some web servers insist on having the "Accept: */*" header, and that others get very upset when you include anything but a very simple "Host: hostname" header.

Other symptoms have included getting unexpected 301 and 302 errors.

I'm off today (which begs the question what am I doing looking at my email ?), and intend to make the most of what is an absolutely fabulous autumnal day in this part of the world ! However, I'll take a longer look tomorrow.
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm

Re: Using Conga to get text files?

Postby Brian|Dyalog on Tue Oct 26, 2010 5:03 pm

Andy is quite right...

Apache seems fussy about having the port specified. Modifying line [33] of HTTPGet will do the trick.
The addition of Accept: */* isn't necessary in this case, but probably a good idea in any event.

Original:
[33] :AndIf 0=⊃r←DRC.Send cmd('GET ',page,' HTTP/1.1',NL,'Host: ',host,':',⍕port,auth,NL,NL)

Modified:
[33] :AndIf 0=⊃r←DRC.Send cmd('GET ',page,' HTTP/1.1',NL,'Host: ',host,NL,'Accept: */*',auth,NL,NL)

Hope this helps...
/Brian Becker
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest