Jeff Abrahamson on 26 Feb 2004 04:51:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] rationalizing .Mac web pages


On Wed, Feb 25, 2004 at 11:28:35PM -0500, Jeff Abrahamson wrote:
> Of course, then, I couldn't just use it as is, I ended up tweaking and
> fiddling to get just what I wanted.  I now have the attached script,
> which admittedly bares little resemblance to the fine script you
> presented, but does just what I want.

Immediately before sending, I attached the GPL info, which I
mistakenly copied from a perl script instead of a bash script.  Here's
the corrected version.  Sorry.

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B
#!/bin/sh

#################################################################
# Copyright (C) 2004 Jeff Abrahamson, see below for important license
# information.

# Grab large images from a .Mac page
# With no arguments, display GPL notice and usage information.
# First argument is URL of .Mac web page
# Second argument is directory in which to store them

#################################################################
# Check arguments, maybe display copyright and usage info.
#
url=$1
if [ "X$url" = "X" ]; then
    echo "
  de.mac, Copyright (C) 2004  Jeff Abrahamson
  de.mac comes with ABSOLUTELY NO WARRANTY; in particular:

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or (at
  your option) any later version.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  USA.

  See also <http://www.fsf.org/copyleft/gpl.html>

  Usage: de.mac URL [directory]
"
    exit
fi
dir=$2
if [ "X$dir" = "X" ]; then
    echo No directory specified, using current directory.
    dir=.
fi

#################################################################
# Now do our thing finally
#
mkdir -p $dir
curl -s $url | grep 'new Slide' | \
    perl -pwe "s/^.*new Slide\('//; s/'.*$//;" | sort -u | \
    xargs wget --quiet --no-directories --no-host-directories \
        --directory-prefix=$dir

Attachment: signature.asc
Description: Digital signature