delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/03/22:01:05

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Can I query the WWW from a DJGPP program?
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <7ot60too6v9k256nb2854jkq9mp62igco1@4ax.com>
References: <8tu6jd$7o9$1 AT news DOT stortek DOT com> <9ld50t0bdc1j4447j7jc73k76u0pq3dg8g AT 4ax DOT com> <qbFM5.9131$mv2 DOT 29116 AT news2-win DOT server DOT ntlworld DOT com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 31
X-Trace: /bdhN9E/EdLwhvk/WjONYbZ55XYEb7JfZMB16h2QlCqotsz6rm4Ff3xkoLSjQ+d2GUCj6IKETJcO!//gb9QrnPBuV7tLL8GnESPaqe8Zx7T2m8fNr19Xoh1bFoYT/OWq1RUvASQh5pPSR+BQEEnLPdq1i!uYO/jQ==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sat, 04 Nov 2000 02:49:35 GMT
Distribution: world
Date: Sat, 04 Nov 2000 02:49:35 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Fri, 3 Nov 2000 20:34:40 -0800, "mike" <my DOT address AT end DOT of DOT article>
wrote:

>I already know what HTTP looks like, and can get the specs,
>but I don't know anything about sockets or lynx-source.

Lynx is an HTTP client and a character-cell HTML browser.
  http://www.trill-home.com/lynx.html
First, make sure Lynx is installed on the PATH, then try this:

int pull_html(const char *url)
{
  char url[], cmdline[256];
  sprintf(cmdline, "lynx -source %s", url);
  system("lynx -source foo.html > temp.tmp")
}

This pulls the requested page into a file called temp.tmp, which you
can fopen() and parse.

I'm using a temporary file instead of a popen() because Lynx on the
PATH is most likely a Win32 build, and AFAIK popen() has problems
between DOS and Win32 programs (i.e. across virtual machines).

-- 
<O
( \   GNOME vs. KDE: the game!
 X    http://pineight.8m.com/nes.htm

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019