There's now a fix for gethttp, available through J's package manager.

FYI,

-- 
Raul

On Sat, Apr 22, 2023 at 3:00 PM Ed Gottsman <edward.j.gotts...@gmail.com> wrote:
>
> Raul,
>
> Escaping the &s fixes the call to code.jsoftware.com 
> <http://code.jsoftware.com/>.  There’s another call, to www.jsoftware.com 
> <http://www.jsoftware.com/>, that looks like this:
>
> https://www.jsoftware.com/cgi-bin/forumsearch.cgi?all=' , (urlencode y) , 
> '&exa=&one=&exc=&add=&sub=&fid=&tim=0&rng=0&dbgn=1&mbgn=1&ybgn=1998&dend=31&mend=12&yend=2030
>
> …escaping whose &s seems to confuse the cgi script (which is very strange—the 
> \s shouldn’t get through to it).  However, I found that *not* escaping 
> them…works.  So I don’t.  (I guess I never tried that one with gethttp.)
>
> I don’t fully understand what’s going on, but I’m going to declare victory 
> until I get a bug report.
>
> Thank you.
>
> Ed
>
>
> > On Apr 22, 2023, at 6:13 PM, Raul Miller <rauldmil...@gmail.com> wrote:
> >
> > I don't think that's it.
> >
> > I think the issue here is that gethttp runs curl, and on OSX, the &
> > character is a command separator (similar to ; or newline, except that
> > it also specifies that the command to its left is run in the
> > background).
> >
> > So, fetching 
> > https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose%E2%80%99
> > using gethttp returns the result of executing at the osx command line
> >
> > search=dyadic%20transpose%E2%80%99
> >
> > This produces an empty result (and sets the environmental variable
> > 'search' to the value 'dyadic%20transpose%E2%80%99', but that is
> > immediately discarded when the subshell exits).
> >
> > In other words, I think gethttp needs to quote the url for use in a
> > shell command before calling curl.
> >
> > In other words, any " or $ or \ characters in the url need to be
> > prefixed with a \ (probably using rplc) and then the resulting string
> > needs a leading " and a trailing " character.
> >
> > Linux should get the same treatment.
> >
> > Thanks,
> >
> > --
> > Raul
> >
> >
> > On Sat, Apr 22, 2023 at 11:55 AM Norman Drinkwater
> > <nrdrinkwa...@gmail.com> wrote:
> >>
> >> On macos, gethttp uses curl. To retrieve multiple urls, I believe you need
> >> to specify a target file to receive each result.
> >> https://everything.curl.dev/usingcurl/downloads/multiple
> >>
> >>
> >> On Sat, Apr 22, 2023 at 9:27 AM Ed Gottsman <edward.j.gotts...@gmail.com>
> >> wrote:
> >>
> >>> Hello.  I’ve been working with gethttp (on the Mac) and have noticed
> >>> something odd.  I’ve boiled it down to
> >>>
> >>>   ('-o ' , jpath '~temp/gethttp.html') gethttp '
> >>> https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose
> >>> '
> >>>
> >>> …works.  It creates a file in ~temp containing the html.  Though,
> >>> strangely, it seems to do it asynchronously—the call returns before the
> >>> file is created and you have to poll for it thereafter.
> >>>
> >>> However,
> >>>
> >>>   $ gethttp '
> >>> https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose’
> >>> <
> >>> https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose%E2%80%99
> >>>>
> >>> 0
> >>>
> >>> …immediately returns no bytes.  (I imagine they’re eventually going to a
> >>> default file somewhere but have not tried to track it down.)
> >>>
> >>> I’ve experimented and it seems as if specifying more than one header
> >>> parameter (or more than two if you specify one with -H and one with &) 
> >>> will
> >>> cause this behavior.
> >>>
> >>> Am I misguided (or hallucinating)?  If not, is there a way to help gethttp
> >>> take multiple headers and still return the html directly and
> >>> synchronously?  (I’d prefer to avoid polling for files.)
> >>>
> >>> Thanks very much.
> >>>
> >>> Ed
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to