Free web development scripts for the webmasterDevelopment Scripts

 Site Navigation
 o Development Scripts
 o Text Only Edition
 o PHP.net News
 o Tutorials
 o Register an account
 o New entries this week
 o Affiliates/Links
 o Contact Us
 o About us
 o Advanced Search

 Browse Path
 o 3 users online
 o Most users online: 67
 o Home
  o Shell
   o Image and Graphics
    o Script

 Member Login
User Name
Password

 Standards
Valid XHTML 1.0!
Valid 
CSS!

 Recommended Links
 o PHP Freaks
 o Designer Baby Clothes
 o Advertise Here Make Money
 o Open Source Design
 o devnet
 o OxyScripts
 o Wedding Vendor Directory
 o designplace
 o Free Wedding Websites

Get the latest Dilbert Cartoon (Rated 5)

Description:

Grab the latest Dilbert Cartoon :)
Essential for a day at work ;)

Code starts here


#!/bin/sh
export http_proxy=http://localhost:80/
dilberthome=$HOME/library/700/790/humour/dilbert
public=/usr/local/etc/httpd/htdocs/
cd /tmp
rm index.html
set `date '+%d %m %y'`
day=$1
month=$2
year=$3
# first get the main page -- this gives us the URL for the picture
if lynx -source http://www.unitedmedia.com/comics/dilbert/index.html > index.html
then
:
else
exit 1
fi
# look for something like dilbert98081090304.gif
picture=`egrep 'dilbert[0-9]*\.gif|dilbert[0-9]*\.[jg][ip][fg]' index.html | head -1 | sed 's/.*\(dilbert[0-9]*\.[jg][ip][gf]\).*/\1/'`
if lynx -dump http://www.unitedmedia.com/comics/dilbert/archive/images/$picture > $picture
then
cp $picture $public/dailydilbert
chmod 644 $public/dailydilbert
echo y | mv $picture $dilberthome
ln -s -f $dilberthome/$picture $HOME/dailydilbert
ln -s -f $dilberthome/$picture $dilberthome/`todaysdate`
exit 0
else
exit 2
fi
exit 0


Submitted by Devscripts on 27-02-2003 20:51


Rate This Script

User Contributed Comments

Registered Members login
© Copyright 2003 - Devscripts.net