🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3220

Re: how to check URL links?

#3220
From: Brian Miller
Date: Tue, 23 Feb 1999 00:00
59 lines
2802 bytes
Peter Caffin wrote:
> 
> Sharkie <sharkie@outlook.net> wrote:
> > I'm looking for a way, or a Unix utility to check
> > URL links. I have a text file with lots of links
> > and want to check if any of the links are broken.
> 
> Actually, this is a bit of a "me too" posting. Hopefully, whatever there
> is will be able to communicate with proxy servers.
> 
> > What's a good way of doing this?
> > Are there any programs/utilities that would do it?
> 
> If there's nothing about, I could probably start writing something, but,
> it'd be silly to reinvent the wheel if there's something already out
> there..
> 
> [x-posted to aus.computers.linux]
> 
> --:     _           _    _ _
>  _oo__ |_|_ |__  _ |  _ |_|_o _  pc at it dot net dot a u |
> //`'\_ | (/_|(/_|  |_(_|| | || |            it.net.au/~pc |
> /

Look at 'lynx', the text based www browser.  You can drive this from a
script with the '-dump' option (I think that's what it is) along with
your URL.  It will dump the HTML, which you can redirect to a file.

  i.e. lynx -dump http://www.linux.org/ > test_url.txt

You may want to use the '-source' instead of '-dump'.

  i.e. lynx -source http://www.linux.org/ > test_url.html

Lynx can use an environment varable 'http_proxy' set to point to a proxy
too.

The look at this file and check for error messages like "page not
found",
or "no server found".

It's been a long time since I did this, and the '-dump' may be wrong, 
but it's something to get you started.

One thing I remember; the script I ran would NOT run from cron!.  The
problem
was lynx needed to find the terminal type, and in a cron job there was
no
terminal type.

Brian
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Brian Miller                                 Telstra
CDN Product Group                            30/242 Exhibition Street
ITG Communication Network Platforms          Melbourne, VIC 3000
bmiller@telstra.com.au                       Australia
Tel: +61-3-9632-3883                         FAX: +61-3-9632-3884
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <36D24D8F.748F1E67@telstra.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <o3Kv2.4$e23.58@news.rdc1.il.home.com> <919353063.88446@beldin.it.net.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,55d8d305899d386f
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 102983,fd780481028c9c25
X-Google-Attributes: gid102983,public
From: Brian Miller <bmiller@telstra.com.au>
Subject: Re: how to check URL links?
Date: 1999/02/23
Message-ID: <36D24D8F.748F1E67@telstra.com.au>
X-Deja-AN: 449476246
Content-Transfer-Encoding: 7bit
References: <o3Kv2.4$e23.58@news.rdc1.il.home.com> <919353063.88446@beldin.it.net.au>
Content-Type: text/plain; charset=us-ascii
Organization: Telstra
Mime-Version: 1.0
Newsgroups: comp.unix.programmer,aus.computers.linux