*+JMJ_---^---------^---------^---------^---------^---------^---------^-- * twgidx - Generate blog-like index.html file for TWOG directory * Copyright 2014 David Meyer program twgidx character twgdir*14, filist*15, indxht*10, dirlin*132, prevdt*10 integer extpos twgdir = 'PAPA.HTML.TWOG' ! TWOG directory on twenex.org filist = 'DIRECTORY.FILES' ! @DIRECTORY file list indxht = 'INDEX.HTML' ! HTML index output file open(20, directory=twgdir, file=filist) open(21, directory=twgdir, file=indxht) call hthead 100 read(20,110, end=900) dirlin 110 format(a132) extpos = index(dirlin, '.TXT.') ! Position of extension ".TXT" ! in file name if (dirlin(2:2) .ne. ' ' .and. extpos .gt. 0) then call artfil(twgdir, dirlin(2:extpos + 3), prevdt) end if go to 100 900 continue call htfoot close(20) close(21) stop end * artfil - Read title and date from named file to generate article link subroutine artfil (fildir, filnam, prevdt) character*(*) fildir, filnam, prevdt character*80 artitl, datlin, arttxt(4), filler, artdat*10 integer i, trimrt open(22, directory=fildir, file=filnam) read(22,110) artitl, filler, datlin, filler, arttxt 110 format(a80) close(22) artdat = datlin(7:16) if (artdat .ne. prevdt) then write(21,120) artdat 120 format('

',a10,'

') prevdt = artdat end if write(21,140) filnam, artitl, arttxt, filnam 140 format('

',a,'

'/'
'/ +a/a/a/a/'...
') return end * hthead - Output HTML file header section subroutine hthead write(21,10) 10 format(''/ +'TWOG - The Twenex Log'/ +'', +'', +''/ +'

TWOG - The Twenex Log

', +'

', +'HOME ', +'PAPA''S CAVE ', +'SUBSCRIBE ', +'ABOUT ', +'CONTACT

'/ +'

Comments and questions are welcome via the ', +'CONTACT form.

') return end * htfoot - Output HTML file footer section subroutine htfoot write(21,10) 10 format('

Powered by: ', +'SDF Public Access UNIX

'/ +'

+JMJ

') return end * trimrt - Return position of last non-space character in string integer function trimrt(string, maxlen) character*(*) string integer maxlen, i i = maxlen 100 if (i .gt. 1 .and. string(i:i) .eq. ' ') then i = i - 1 go to 100 endif if (string(i:i) .eq. ' ') then trimrt = 0 else trimrt = i endif return end *+JMJ_---^---------^---------^---------^---------^---------^---------^--