#!/bin/sh

#	.mkaff.sh -	Generates the "Affinity" Profile webpage
#		Author:	Jack C Lipton
#
#
#

HTML=affinity.html		# resultant file
LIST=.squicks			# list of "squick" categories


AWK=/tmp/mkaffA.$$		# awk script
TMP=/tmp/mkaffT.$$		# volatile file


#
#	We used to have an internal copy of the list.  I'm keeping
#	this only as a backup...
#

false	&&			\
cat				>${LIST}		<<AFFINITIES
_Orientation
het|Heterosexuality
nosex|No Sex
-
gayM|Male Homosexuality
gayF|Female Homosexuality
-
pedM|Pedophilia - Male
pedF|Pedophilia - Female
-
purity|Purity Tests
_Activities
soloM|Masturbation - Male
soloF|Masturbation - Female
-
oralM|Fellatio
oralF|Cunnilingus
-
slutM|Slut-like behavior of Male (usually implied)
slutF|Slut-like behavior of Female
-
analM|Anal Penetration of Male
analF|Anal Penetration of Female
water|Water Sports
copr|Coprophilia
-
rape|Forcible Rape
nc|Not as Forcible Rape, but still Rape-Like
reluc|Delayed enthusiasm after reluctance
con|Consensual (usually implied)
first|First Time for a participant
-
vanilla|Couple going at it ("Vanilla" implied)
moreM|More Males - >1M, 1F
moreF|More Females - 1M, >1F
group|Group - >1M >1F
orgy|Orgy - too many of each to count
swap|Spouse (or reasonable facsimile) Swapping
-
voy|Voyeurism
exhib|Exhibitionism
inc|Incest
-
preg|Pregnancy as a Result
-
snuff|Snuff (this squicks the author of this menu)
pain|Pain (Sado/Maso)
bond|Bondage
cbt|Cock/Ball Torture
remf|Rear-Echelon Mother F**kers
_Techno-Philia/Phobia Background
nano|NanoTechnology
micro|MicroComputers
macro|Servers
bfc|Big F**king Computers - "Never trust a computer you can lift"
_Transportation Modes Mentioned
mcyc|MotorCycles
car|Cars ("Cages")
truck|Trucks
buses|Buses
plane|Planes
space|Space
_Authors
scas|SCAS Postings
eli|Eli (bearded or not)
elf|Elf Sternberg (implies "furry")
cmsix|"Truck's Tops and See-Bees"
mccoy|Frank McCoy (Should turn on pedF, inc and preg)
desdmona|Desdmon - DesD's a real "Mona" (moaner)
nonsage|Saggitaria
jcl|Shell/AWK Scripting in an erotic story
_Story "Technical" Issues
proof|Proofread but not edited, errors retained
denny|Proofread and errors corrected
arith|Arithmatic issues reviewed and corrected
-
cglut|Author is a Code Glutton
_Weird F**king Stuff
psi|Psi - Teeps, Teeks and Mages Oh My!
tg|Trans-Gender
magic|Magical stuff
-
furry|Furry
-
piston|Uses words like "pistoning" in unusual places
-
fv|Florida Voters (implies idiocy in story)
_Peeves
spelling|Spelling accuracy
mute|Word choice - uses "mute" where "moot" is meant
waste|Word choice - uses "waste" where "waist" is meant
grammar|Sentence formation / Grammar
AFFINITIES

#
#
#

cat				>${HTML}+		<<HTMLFILE
<HTML>

<HEAD>
	<TITLE>Story Affinity Profile - Test</TITLE>
</HEAD>

<BODY>

<H1 ALIGN=CENTER>Story Affinity Profile<BR>Test Page</H1>

This is a prototypical form developed by <A HREF="mailto:liptonsoup1951@yahoo.com">Jack C Lipton</A>.	<BR>
You can download a copy of the generating script from
<A HREF="http://www.asstr.org/~CupaSoup/.mkaff.sh">http://www.asstr.org/~CupaSoup/.mkaff.sh</A>
and the 
<A HREF="http://www.asstr.org/~CupaSoup/.squicks">http://www.asstr.org/~CupaSoup/.squicks</A>
file is used to generate the menu.		<BR>

There are more than a few entries intended to get a laugh.
I'll even settle for chuckles.			<BR>

Another version can be seen <A HREF="squick.html">here</A>		<BR>

<BR>

<FORM>

HTMLFILE


cat				>$AWK			<<AWKSCRIPT
BEGIN	{
		FS =		"|";
		inlist =	0;

		STEPLIST[1] =	"++preferred";
		STEPLIST[2] =	"+OK";
		STEPLIST[3] =	"neutral";
		STEPLIST[4] =	"-avoid";
		STEPLIST[5] =	"--squick";

		steps =		5;
	}
/^_/	{	# handle a section header

		if ( inlist != 0 ) {
			printf( "</UL>\n\n");
		}

		printf( "<BR><H2>%s</H2>\n<UL>\n", substr(\$0,2));
		inlist =	1;

		next;
	}
/^-$/	{	# inserts a blank line (results vary)

		if ( inlist == 0 ) {
			printf( "<UL>");
		} else {
#			printf( "</UL><BR><UL>");
			printf( "</UL><UL>");
		}
		next;
	}
	{	# acquire the varname and the description we're working with
		varname =	\$1;
		description =	\$2;
	}
	{
		printf( "  <LI>\t<SELECT NAME=\\"%s\\">\n", varname);

		for ( ndx = 1 ; ndx <= steps ; ndx++ ) {
			key =		STEPLIST[ndx];
			if ( ndx == 3 ) {
				printf( "\t\t<OPTION VALUE=\\"%s\\" SELECTED>%s\n", key, key);
			} else {
				printf( "\t\t<OPTION VALUE=\\"%s\\">%s\n", key, key);
			}
		}

		printf( "\t</SELECT>\t%s\n\n", description);
	}
END	{
		if ( inlist != 0 ) {
			printf( "</UL>\n\n");
		}

		printf( "</FORM>\n\n<HR SIZE=5>\n<CENTER>\n");
		printf( "Copyright (c) 2002 - Jack C Lipton<BR>\n");
		printf( "</CENTER>\n\n</BODY>\n\n</HTML>\n");
	}
AWKSCRIPT

awk	-f $AWK		$LIST				>>${HTML}+

cutover	$HTML

rm -f		$AWK	$TMP

exit	0