Skip to Content.
Sympa Menu

baslinux - Re: [BL] script to extract http://'s from a doc. 5B

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Lee Forrest <lforrestster AT gmail.com>
  • To: baslinux AT lists.ibiblio.org, keesan AT sdf.lonestar.org
  • Subject: Re: [BL] script to extract http://'s from a doc. 5B
  • Date: Thu, 1 Mar 2007 20:13:57 +0000

On Fri, Mar 02, 2007 at 02:58:37AM +0000, sindi keesan wrote:
> On Thu, 1 Mar 2007, Lee Forrest wrote:
>
> > On Thu, Mar 01, 2007 at 02:49:19PM +0000, Lee Forrest wrote:
> > [delete]
> >
> > First script was sloppy. This truly deals with links, puts
> > "http://"; in front of "www", uses the original url from the
> > file as the link name so that you can see which link is which,
> > and puts ".html" at the end of the resultant file so that a
> > browser knows it is to be interpreted as an html doc.
> >
> > #!/bin/sh
> >
> > #script.sh
> >
> > #usage: script.sh file_with_urls
> >
> > echo "<html><head></head><body>" > links.html
> >
> > sed -n 's@^\(.*\)\(http://\|www\)\([^ ><"]*\)\(.*\)@<p><a
> > href="\2\3">\2\3</a>@p' "$1" | sed 's@\"www@\"http://www@' >> links.html
> >
> > echo "</body></html>" >> links.html
> >
> > links links.html
> >
> > [delete]
>
> This produced a file called links.html with only the html tags.

Didn't here. I'll bet the sed part got chopped into two lines

when you copied it. That happens a lot.

Should be all one line 'sed -n ... www@' >> links.html'

About urlview, you can configure it to do anything you want,
including ignoring mailto tags and such.

If you need any space to store files, my FTP server has about
5Gb. A lot more if necessary. I could write a script that would
send you my IP whenever I was online. No one can delete anything
from the main dir and you could have your own private subdir
if you wanted, password protected. Purely anonymous otherwise,
upload and download.

Lee

--
BasicLinux: Small is Beautiful
http://www.basiclinux.com.ru





Archive powered by MHonArc 2.6.24.

Top of Page