Introduction
Statistics
Contact
Development
Disclaimer
Help
!/bin/ksh
Written by Christian Mongeau in 2009.
This script is hereby placed in the public domain.
You can change the name of the script to whatever you like.
The only variable that you really need to adjust is $GOPHER_PATH
You'll need $SCRIPT_DIR and, eventually, $SCRIPT_DIR
############################# BEGIN CONFIGURATION ########################
OPHER_PATH=/ftp/pub/users/chr
CRIPT_DIR=bin
ATA_DIR=data
EFAULT_ACTION='sort_vote'
LLOWED_CHARS='- a-zA-Z0-9:;//._' # Other chars will be removed from the link
_POSITIVE=ok
_NEGATIVE=ko
TRING_OK='OK:'
TRING_KO='KO:'
############################# END CONFIGURATION ##########################
cript_name=$(basename $0)
OPHIT_DATA=$GOPHER_PATH/$DATA_DIR/$(echo $script_name | cut -d '.' -f1).data
opherspace_path=$(echo $GOPHER_PATH | sed 's@/ftp/pub@@')
andom=$(jot -r -c 5 a z | rs -g 0 5)
MPFILE=/tmp/$random
f [[ -n $SCRIPT_DIR ]] ; then
lse
i
DEBUG
cat $GOPHIT_DATA.1260001815 && exit 1
ir=$GOPHER_PATH/$DATA_DIR
[ ! -d $dir ]] && \
"Sorry, there's no $dir. Create it and chmod 750 $dir" && exit 1
[ ! -f $GOPHIT_DATA ]] && \
"Sorry, there's no $dir. Create it and chmod 660 $GOPHIT_DATA" && exit 1
xtract() {
or i in $(grep -n '^@' ${GOPHIT_DATA} | cut -d ':' -f1) ; do
one
eader() {
ort_vote() {
eader
cho "1Sort by date
cho "1Show comments
ort_by=vote
xtract
orted=$(print "$ideas" | sort -r)
FS='
or i in $(echo "$sorted") ; do
one
ort_date() {
eader
cho "1Sort by votes
cho "1Show comments
ort_by=date
xtract
orted=$(print "$ideas" | sort -r)
FS='
or i in $(echo "$sorted") ; do
one
heck_link(){
n_links() {
dd_main() {
ote_main() {
f [[ -n $2 ]] ; then
lse
i