all: index.disk index.htm index.web replaytv_contents.html tv_episodes.html tv.html calendar.html friends_sites.html interesting_sites.html hijack_sched.html edit.rtv icons/friends_collage.html icons/user_pics icons/DW_user_pics icons/copy-paste.html icons/mood_icons.html # mythtv_upcoming.html mythtv_expire.html mythtv_contents.html mythtv_cbs_sun.html workspam.html spam.png photos $(HOME)/commands/upload.web local: index.web replaytv_contents.html tv_episodes.html tv.html calendar.html friends_sites.html interesting_sites.html hijack_sched.html edit.rtv icons/friends_collage.html icons/user_pics icons/DW_user_pics icons/copy-paste.html icons/mood_icons.html # mythtv_upcoming.html mythtv_expire.html mythtv_contents.html mythtv_cbs_sun.html workspam.html spam.png photos upload: $(HOME)/commands/upload.web redo: touch -r .subdirs .newfiles calendar.html: $(HOME)/commands/mk_calendar ~/personal/calendar/calendar.tbl awk.calendar mk_calendar # ./awk.calendar < ~/personal/calendar/calendar.tbl > calendar.html $(HOME)/commands/mk_calendar ~/personal/calendar/calendar.tbl > calendar.html day-old: FORCE # ls -lT day-old ls -l day-old $(HOME)/commands/touch-24 day-old ls -l day-old hours-old: FORCE # ls -lT hours-old ls -l hours-old $(HOME)/commands/touch-4 hours-old ls -l hours-old FORCE: photos: FORCE /usr/bin/lazygal --pic-sort-by=filename --clean-destination --image-size=small=660x495 -O -o $(HOME)/webpages/bdchivers/photos $(HOME)/webpages/photos/bdchivers # --webalbum-pic-type=tidy # /usr/bin/lazygal --image-size=small=660x495 -O --orig-symlink -o $(HOME)/webpages/bdchivers/photos $(HOME)/webpages/photos/bdchivers # correct stale link to lazygal website. /usr/bin/find photos -type f | /bin/grep html | /usr/bin/xargs /home/bchivers/commands/chstrp dyndns.org zincube.net index.disk: index.html cat index.html | sed -e 's---' > index.disk index.htm: index.html cat index.html | sed -e 's---' > index.htm index.web: index.html cat index.html | sed -e 's---' > index.web icons/friends_collage.html: $(HOME)/commands/icons.collage $(HOME)/commands/title-tag icons/friends_collage.head icons/friends_collage.tail day-old cat icons/friends_collage.head > icons/friends_collage.html date +'

Last Updated: %R %A, %e %B %Y

' >> icons/friends_collage.html $(HOME)/commands/icons.collage syntonic_comma | sed 's_\(\)_\2_' >> icons/friends_collage.html cat icons/friends_collage.tail >> icons/friends_collage.html $(HOME)/commands/title-tag icons/friends_collage.html > /dev/null icons/friends_collage2.html: $(HOME)/commands/icons.collage2 $(HOME)/commands/title-tag icons/friends_collage.head icons/friends_collage.tail day-old cat icons/friends_collage.head > icons/friends_collage2.html date +'

Last Updated: %R %A, %e %B %Y

' >> icons/friends_collage2.html # $(HOME)/commands/icons.collage2 syntonic_comma | sed 's_\(\)_\2_' >> icons/friends_collage2.html $(HOME)/commands/icons.collage2 syntonic_comma >> icons/friends_collage2.html cat icons/friends_collage.tail >> icons/friends_collage2.html icons/index.html: $(HOME)/commands/title-tag icons/DW_user_pics icons/user_pics icons icons/put_user_pics $(HOME)/commands/title-tag icons/index.html icons/user_pics: $(HOME)/commands/title-tag icons/get_user_pics day-old icons/get_user_pics > icons/user_pics $(HOME)/commands/title-tag icons/user_pics icons/DW_user_pics: $(HOME)/commands/title-tag icons/get_DW_user_pics day-old icons/get_DW_user_pics > icons/DW_user_pics $(HOME)/commands/title-tag icons/DW_user_pics icons/copy-paste.html: icons/index.html icons/copy-paste.head icons/copy-paste.tail icons/mk_copy-paste icons/awk.copy-paste icons/mk_copy-paste icons/mood_icons.html: $(HOME)/commands/icons.moods icons/mood_icons.head icons/mood_icons.tail icons/gifts_list cat icons/mood_icons.head > icons/mood_icons.html $(HOME)/commands/icons.moods >> icons/mood_icons.html cat icons/mood_icons.tail >> icons/mood_icons.html icons/gifts_list: day-old $(HOME)/commands/icons.gifts_list hijack_sched.html: $(HOME)/awk/awk.hijack.sched hijack_sched hijack_sched.head hijack_sched.tail # file_date := $(shell ls -l hijack_sched | sed 's/ */ /g' | cut -d' ' -f8,6,7) # pipes don't seem to work in $shell # sed "s/W_H_E_N/$(file_date)/" hijack_sched.head > hijack_sched.html # `ls -l hijack_sched | awk '{print $8 " " $6 " " $7}'` # also tried awk instead of sed|cut; couldn't make it work # sed "s/W_H_E_N/`ls -l hijack_sched | sed 's/ */ /g' | cut -d' ' -f8,6,7`/" hijack_sched.head > hijack_sched.html # need double $$ on awk variables to escape through "make". # sed "s/W_H_E_N/`ls -lT hijack_sched | sed 's/:[0-5][0-9] / /' | awk '{print $$8 " " $$6 " " $$7 ", " $$9 "."}' `/" hijack_sched.head > hijack_sched.html sed "s/W_H_E_N/`ls -l hijack_sched | sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | awk '{print $$8 " " $$6 " " $$7 "."}' `/" hijack_sched.head > hijack_sched.html $(HOME)/awk/awk.hijack.sched hijack_sched | sed -e 's/QuickTime//' -e 's/Real//' -e 's/iTunes//' -e 's/VLC//' >> hijack_sched.html cat hijack_sched.tail >> hijack_sched.html friends_sites.html: $(HOME)/commands/mk.html.tbl4 friends_sites friends_sites.head friends_sites.tail $(HOME)/commands/mk.html.tbl4 friends_sites interesting_sites.html: $(HOME)/commands/mk.html.tbl3c interesting_sites interesting_sites.head interesting_sites.tail $(HOME)/commands/mk.html.tbl3c interesting_sites # Get MythTV contents from the MythWeb Recorded page; filter out most of the output, keeping: # x-title -> # Show Title # x-subtitle -> # Episode Title # x-programid -> # Program ID (2ndary sort field); manual records won't have a program ID # x-channum -> # Station # x-airdate -> # Day, Date, Time # x-length -> # Run Length # x-filesize -> # File Size # x-progflags -> has the possible autoexpire.png and watched.png icons # id="inforow_[1-9] -> use as a marker for the beginning of the next item; inforow_0 preceeds the first item and is ignored; no marker follows last, so use "END" # id="programcount" -> has total time and space used # strip off leading blanks, trailing and tags, tags, leading "::"s marking manual title/subtitle corrections # convert AM/PM time to 24-hour clock # convert selected hr+min lengths to just minutes (do 61-70 min and 90 min; 90 min registers quickly; 75/105 min don't) # combine selected data into one line per program; note autoexpired and/or watched program; start new program with each inforow_ # put the programcount data (total time, size) into a separate file # programs with no subtitle or no programID will have 2 tabs together; insert "-"s to preserve fields # use last 3 digits of Program ID as subtitle for programs with no subtitle ("-" added above) that are EPisodes (Program ID begins with "EP") # duplicate the program title and strip off any leading A|An|The before sorting # Sort by (added) Show Title, Program ID, and date (YYYY MM DD HH:MM) ignoring case; field separator is TAB # remove extra title after sort # # strip HTML tags from programcount data (total time, size) and file separately by today's date; we'll accumulate usage history # edit to fix bogus meta-character sequences that may come from MythTV page scrape. # edit episode numbers into the data file # edit again to "
" break any text that is so long that it messes up the webpage mythtv_contents: hours-old edit.fix.mythcontents edit.epi.nos.txt # makefile /usr/bin/lynx -source 'http://192.168.2.11/mythweb/tv/recorded' | /bin/egrep 'x-title|x-subtitle|x-programid|x-channum|x-airdate|x-length|x-filesize|x-progflags|id="inforow_[1-9]|id="programcount"' | /bin/sed -e 's/^ *//' -e 's=$$==' -e 's=
$$==' -e 's///' -e 's/>::/>/' -e 's/ (12:\([0-5][0-9]\) PM)/ 12:\1/' -e 's/ (01:\([0-5][0-9]\) PM)/ 13:\1/' -e 's/ (02:\([0-5][0-9]\) PM)/ 14:\1/' -e 's/ (03:\([0-5][0-9]\) PM)/ 15:\1/' -e 's/ (04:\([0-5][0-9]\) PM)/ 16:\1/' -e 's/ (05:\([0-5][0-9]\) PM)/ 17:\1/' -e 's/ (06:\([0-5][0-9]\) PM)/ 18:\1/' -e 's/ (07:\([0-5][0-9]\) PM)/ 19:\1/' -e 's/ (08:\([0-5][0-9]\) PM)/ 20:\1/' -e 's/ (09:\([0-5][0-9]\) PM)/ 21:\1/' -e 's/ (10:\([0-5][0-9]\) PM)/ 22:\1/' -e 's/ (11:\([0-5][0-9]\) PM)/ 23:\1/' -e 's/ (12:\([0-5][0-9]\) AM)/ 00:\1/' -e 's/ (\([01][0-9]:[0-5][0-9]\) AM)/ \1/' -e 's/\(x-length.* min\)s/\1/' -e 's/>1 hr \([1-9]\) min/>6\1 min/' -e 's/>1 hr 10 min/>70 min/' -e 's/>1 hr 30 min/>90 min/' | /usr/bin/awk '// { printf ("%s\t", substr ($$0, 21)) } ; // { printf ("%s\t", substr ($$0, 24)) } ; // { printf ("%s\t", substr ($$0, 25)) } ; // { printf ("%s\t", substr ($$0, 23)) } ; // { printf ("%s %s %s %s\t", substr ($$0, 23, 3), substr ($$0, 35, 4), substr ($$0, 27, 6), substr ($$0, 40)) } ; // { printf ("%s\t", substr ($$0, 22)) } ; // { printf ("%s", substr ($$0, 24)) } ; /autoexpire.png/ { printf ("\tAuToExP") } ; /watched.png/ { printf ("\tWaTcHeD") } ; // { print > "mythtv_totals" } ; END { printf ("\n") }' | /bin/sed -e 's/ / - /g' -e 's/ - \(EP[0-9]*\)\([0-9][0-9][0-9]\) / \2 \1\2 /' -e 's/^[^ ]* /&&/' -e 's/^[Aa] //' -e 's/^[Aa]n //' -e 's/^[Tt]he //' | /usr/bin/sort -f -t' ' -k 1,2 -k 4.3,5 -k 6.5,6.9 -k 6.10,6.13M -k 6.14,6 | /bin/sed -e 's/^[^ ]* //' > mythtv_contents /bin/sed 's/<[^>]*>//g' mythtv_totals > mythtv_totals.`/bin/date '+%Y%m%d'` /bin/ed mythtv_contents < edit.fix.mythcontents /bin/ed mythtv_contents < edit.epi.nos.txt /bin/cp -p mythtv_contents mythtv_contents.`/bin/date '+%Y%m%d'` # any episode title named "Pilot", ending with " (Pilot)", or numbered "[01].[01]" or "[01].[0][01]", # (filter out "^The Aviators") mythtv_pilots: mythtv_contents /usr/bin/awk -F ' ' '\ $$2 ~ / \(Pilot\)$$/ {print ; next} \ $$2 == "Pilot" {print ; next} \ $$2 ~ /^1\/[1-9] / {print ; next} \ $$2 ~ /^00[01]$$/ {print ; next} \ $$2 ~ /^[01]\.? / {print ; next} \ $$2 ~ /^[01]\.0?[01] / {print} ' mythtv_contents > mythtv_pilots #$$2 ~ /^[01]\.? Pilot$$/ {print ; next} \ #$$2 ~ /^[01]\.0?[01] Pilot$$/ {print ; next} \ # possibly insert this line above # $$2 ~ /^1\\\\.1 / {print ; next} \ # Get deleted MythTV programs like the available content above, from slightly different MythWeb URL # If you ask for the deleted shows when there are none, you'll get everything else. # So if mythtv_deleted has the same number of lines as mythtv_contents, assume there's no deleted shows and empty the file ; # else edit it like mythtv_contents. # (This can get fooled if the contents change between requesting mythtv_contents and mythtv_deleted.) # Run $(HOME)/commands/mk-mythtv_contents_rec to create daily lists of new recordings for previous days. mythtv_deleted: hours-old edit.fix.mythcontents edit.epi.nos.txt # makefile /usr/bin/lynx -source 'http://192.168.2.11/mythweb/tv/recorded?recgroup=Deleted' | /bin/egrep 'x-title|x-subtitle|x-programid|x-channum|x-airdate|x-length|x-filesize|x-progflags|id="inforow_[1-9]|id="programcount"' | /bin/sed -e 's/^ *//' -e 's=$$==' -e 's=$$==' -e 's///' -e 's/>::/>/' -e 's/ (12:\([0-5][0-9]\) PM)/ 12:\1/' -e 's/ (01:\([0-5][0-9]\) PM)/ 13:\1/' -e 's/ (02:\([0-5][0-9]\) PM)/ 14:\1/' -e 's/ (03:\([0-5][0-9]\) PM)/ 15:\1/' -e 's/ (04:\([0-5][0-9]\) PM)/ 16:\1/' -e 's/ (05:\([0-5][0-9]\) PM)/ 17:\1/' -e 's/ (06:\([0-5][0-9]\) PM)/ 18:\1/' -e 's/ (07:\([0-5][0-9]\) PM)/ 19:\1/' -e 's/ (08:\([0-5][0-9]\) PM)/ 20:\1/' -e 's/ (09:\([0-5][0-9]\) PM)/ 21:\1/' -e 's/ (10:\([0-5][0-9]\) PM)/ 22:\1/' -e 's/ (11:\([0-5][0-9]\) PM)/ 23:\1/' -e 's/ (12:\([0-5][0-9]\) AM)/ 00:\1/' -e 's/ (\([01][0-9]:[0-5][0-9]\) AM)/ \1/' -e 's/\(x-length.* min\)s/\1/' -e 's/>1 hr \([1-9]\) min/>6\1 min/' -e 's/>1 hr 10 min/>70 min/' -e 's/>1 hr 30 min/>90 min/' | /usr/bin/awk '// { printf ("%s\t", substr ($$0, 21)) } ; // { printf ("%s\t", substr ($$0, 24)) } ; // { printf ("%s\t", substr ($$0, 25)) } ; // { printf ("%s\t", substr ($$0, 23)) } ; // { printf ("%s %s %s %s\t", substr ($$0, 23, 3), substr ($$0, 35, 4), substr ($$0, 27, 6), substr ($$0, 40)) } ; // { printf ("%s\t", substr ($$0, 22)) } ; // { printf ("%s", substr ($$0, 24)) } ; /autoexpire.png/ { printf ("\tAuToExP") } ; /watched.png/ { printf ("\tWaTcHeD") } ; / mythtv_deleted if /usr/bin/test `/usr/bin/wc -l mythtv_contents|/usr/bin/awk '{print $$1}'` -eq `/usr/bin/wc -l mythtv_deleted|/usr/bin/awk '{print $$1}'` ; then /bin/echo "There are no deleted shows." ; /bin/cat /dev/null > mythtv_deleted ; else /bin/ed mythtv_deleted < edit.fix.mythcontents ; /bin/ed mythtv_deleted < edit.epi.nos.txt ; fi /bin/cp -p mythtv_deleted mythtv_deleted.`/bin/date '+%Y%m%d'` $(HOME)/commands/mk-mythtv_contents_rec # Get LiveTV MythTV programs like the available content above, from slightly different MythWeb URL # If you ask for the LiveTV shows when there are none, you'll get everything else. # So if mythtv_livetv has the same number of lines as mythtv_contents, assume there's no LiveTV shows and empty the file ; # else edit it like mythtv_contents. # (This can get fooled if the contents change between requesting mythtv_contents and mythtv_livetv.) mythtv_livetv: hours-old edit.fix.mythcontents edit.epi.nos.txt # makefile /usr/bin/lynx -source 'http://192.168.2.11/mythweb/tv/recorded?recgroup=LiveTV' | /bin/egrep 'x-title|x-subtitle|x-programid|x-channum|x-airdate|x-length|x-filesize|x-progflags|id="inforow_[1-9]|id="programcount"' | /bin/sed -e 's/^ *//' -e 's=$$==' -e 's=$$==' -e 's///' -e 's/>::/>/' -e 's/ (12:\([0-5][0-9]\) PM)/ 12:\1/' -e 's/ (01:\([0-5][0-9]\) PM)/ 13:\1/' -e 's/ (02:\([0-5][0-9]\) PM)/ 14:\1/' -e 's/ (03:\([0-5][0-9]\) PM)/ 15:\1/' -e 's/ (04:\([0-5][0-9]\) PM)/ 16:\1/' -e 's/ (05:\([0-5][0-9]\) PM)/ 17:\1/' -e 's/ (06:\([0-5][0-9]\) PM)/ 18:\1/' -e 's/ (07:\([0-5][0-9]\) PM)/ 19:\1/' -e 's/ (08:\([0-5][0-9]\) PM)/ 20:\1/' -e 's/ (09:\([0-5][0-9]\) PM)/ 21:\1/' -e 's/ (10:\([0-5][0-9]\) PM)/ 22:\1/' -e 's/ (11:\([0-5][0-9]\) PM)/ 23:\1/' -e 's/ (12:\([0-5][0-9]\) AM)/ 00:\1/' -e 's/ (\([01][0-9]:[0-5][0-9]\) AM)/ \1/' -e 's/\(x-length.* min\)s/\1/' -e 's/>1 hr \([1-9]\) min/>6\1 min/' -e 's/>1 hr 10 min/>70 min/' -e 's/>1 hr 30 min/>90 min/' | /usr/bin/awk '// { printf ("%s\t", substr ($$0, 21)) } ; // { printf ("%s\t", substr ($$0, 24)) } ; // { printf ("%s\t", substr ($$0, 25)) } ; // { printf ("%s\t", substr ($$0, 23)) } ; // { printf ("%s %s %s %s\t", substr ($$0, 23, 3), substr ($$0, 35, 4), substr ($$0, 27, 6), substr ($$0, 40)) } ; // { printf ("%s\t", substr ($$0, 22)) } ; // { printf ("%s", substr ($$0, 24)) } ; /autoexpire.png/ { printf ("\tAuToExP") } ; /watched.png/ { printf ("\tWaTcHeD") } ; / mythtv_livetv if /usr/bin/test `/usr/bin/wc -l mythtv_contents|/usr/bin/awk '{print $$1}'` -eq `/usr/bin/wc -l mythtv_livetv|/usr/bin/awk '{print $$1}'` ; then /bin/echo "There are no LiveTV shows." ; /bin/cat /dev/null > mythtv_livetv ; else /bin/ed mythtv_livetv < edit.fix.mythcontents ; /bin/ed mythtv_livetv < edit.epi.nos.txt ; fi /bin/cp -p mythtv_livetv mythtv_livetv.`/bin/date '+%Y%m%d'` # Get upcoming MythTV programs from MythWeb URL # # Show and Episode Title # -> # Station # .*M -> # Day, Date, Time # -> # Run Length # keep lines that begin "SD #" or "HD #"; others are shows that match searches but won't record # remove extra space between show title and episode title # convert AM/PM time to 24-hour clock # convert selected hr+min lengths to just minutes (do 61-70 min and 90 min; 90 min registers quickly; 75/105 min don't) # rearrange the line to put the tuner at the end # # edit to fix bogus meta-character sequences that may come from MythTV page scrape. # edit episode numbers into the data file # # duplicate the program title and strip off any leading A|An|The before sorting # Sort by (added) Show+Episode Title and date (YYYY MM DD HH:MM) ignoring case; field separator is TAB # remove extra title after sort # # awk changed in a Linux update yesterday, and broke this entry; mawk seems to fix it. 2011/01/19 mythtv_upcoming: hours-old edit.fix.mythcontents edit.mythtv_upcoming # makefile /usr/bin/lynx -source 'http://192.168.2.11/mythweb/tv/upcoming' | /usr/bin/mawk 'BEGIN { FS="[\<\>]" } ; /\/ { printf ("\n%s\t", $$3) } ; /\/ { printf ("\n%s\t", $$3) } ; /\/ { printf ("%s\t", $$3) } ; /\.*M\)/ { printf ("%s\n", $$3) }' | /bin/egrep '^[HS]D [0-3] ' | /bin/sed -e 's/^ *//' -e 's/: /: /' -e 's/ (12:\([0-5][0-9]\) PM)/ 12:\1/' -e 's/ (01:\([0-5][0-9]\) PM)/ 13:\1/' -e 's/ (02:\([0-5][0-9]\) PM)/ 14:\1/' -e 's/ (03:\([0-5][0-9]\) PM)/ 15:\1/' -e 's/ (04:\([0-5][0-9]\) PM)/ 16:\1/' -e 's/ (05:\([0-5][0-9]\) PM)/ 17:\1/' -e 's/ (06:\([0-5][0-9]\) PM)/ 18:\1/' -e 's/ (07:\([0-5][0-9]\) PM)/ 19:\1/' -e 's/ (08:\([0-5][0-9]\) PM)/ 20:\1/' -e 's/ (09:\([0-5][0-9]\) PM)/ 21:\1/' -e 's/ (10:\([0-5][0-9]\) PM)/ 22:\1/' -e 's/ (11:\([0-5][0-9]\) PM)/ 23:\1/' -e 's/ (12:\([0-5][0-9]\) AM)/ 00:\1/' -e 's/ (\([01][0-9]:[0-5][0-9]\) AM)/ \1/' -e 's/\(x-length.* min\)s/\1/' -e 's/>1 hr \([1-9]\) min/>6\1 min/' -e 's/>1 hr 10 min/>70 min/' -e 's/>1 hr 30 min/>90 min/' | /usr/bin/awk -F' ' '{printf ("%s\t%s\t%s\t%s\t%s\n", $$2, $$3, $$4, $$5, $$1)}' > mythtv_upcoming.raw /bin/ed mythtv_upcoming.raw < edit.fix.mythcontents /bin/ed mythtv_upcoming.raw < edit.mythtv_upcoming # /usr/bin/awk -F ' ' '{printf ("%s\t%s\n", $$1, $$0)}' mythtv_upcoming.raw | /bin/sed -e 's/^[Aa] //' -e 's/^[Aa]n //' -e 's/^[Tt]he //' | /usr/bin/sort -f -t' ' -k 1,1 -k 4.13,4.16 -k 4.5,4.7M -k 4.9,4.10n -k 4.18,4.22 | /bin/sed -e 's/^[^ ]* //' > mythtv_upcoming /usr/bin/awk -F ' ' '{printf ("%s\t%s\n", $$1, $$0)}' mythtv_upcoming.raw | /bin/sed -e 's/^[Aa] //' -e 's/^[Aa]n //' -e 's/^[Tt]he //' | /usr/bin/sort -f -t' ' -k 1,1 -k 4.13,4.16 -k 4.5,4.7M -k 4.9,4.10n -k 4.18,4.22 | /usr/bin/awk -F ' ' '{printf ("%s\t%s\t%s\t%s\t%s\n", $$2, $$3, $$4, $$5, $$6)}' > mythtv_upcoming ## /bin/cp -p mythtv_upcoming mythtv_upcoming.`/bin/date '+%Y%m%d'` mythtv_upcoming_hd: mythtv_upcoming # /usr/bin/awk -F ' ' '/.*-HD/ {print}' < mythtv_upcoming > mythtv_upcoming_hd /bin/fgrep 'HD ' < mythtv_upcoming > mythtv_upcoming_hd # get space-usage and mythfilldatabase-connect data from the MythWeb Status page; reformat space data into a table; strip HTML out of mythfill timestamp. # don't filter the http://192.168.2.11/mythweb/status info through meta-html mythtv_status: hours-old # makefile /usr/bin/lynx -dump -width 300 http://192.168.2.11/mythweb/status | /usr/bin/awk '/Total Disk Space:/,/ guide data until / {print}' | /bin/sed 's/^[*+o ]*//' | /bin/sed -e 's/ started on/:/' -e 's=-=/=g' -e 's/ and ended on .......... ....../:/' -e 's/ sources. This / sources.
This /' | /usr/bin/awk 'BEGIN { printf ("
\n\n")} ; /^Total Disk Space:/ { printf ("") } ; /^Space Available After Auto.expire: / { avail_exp = $$5 " " $$6 } ; /^Space Used by LiveTV: / { used_live = $$5 " " $$6 } ; /^Space Used by Deleted Recordings: / { used_del = $$6 " " $$7 } ; /^Total Space: / { printf ("", $$3, $$4) } ; /^Space Used by Auto.expirable Recordings: / { used_exp = $$6 " " $$7 } ; /^Directory: / { printf ("", $$2) } ; /^Space Used: / { printf ("", $$3, $$4) } ; /^Space Free: / { printf ("\n", $$3, $$4) } ; /^Last mythfilldatabase run: / { printf ("\n\n\n
DirectoryTotal SpaceSpace UsedSpace Free
Total Disk Space%s %s
%s%s %s%s %s
Auto-Expirable Recordings%s%s
Deleted Recordings%s
Live TV%s
\n
%s
\n", used_exp, avail_exp, used_del, used_live, $$0) } ; / guide data until / { printf ("%s
\n", $$0) }' > mythtv_status # get the timestamp from the mythtv_upcoming data-extract file; use it after mythtv_upcoming.head1. # use awk to reformat the captured data into HTML table rows. # present in original order (by program), # then sort by date/time and accumulate number of shows and time by day. # standard def uses 2.2GB/HR; high-def varies 0.4 to 6.4 GB/HR, assume 5GB/HR. # (MythWev listing run lengths has mins plural here, but min singular on other pages.) # extract a list of upcoming HD recordings. mythtv_upcoming.html: mythtv_upcoming mythtv_upcoming_hd mythtv_status mythtv_upcoming.head1 mythtv_upcoming.head2 mythtv_upcoming.head3 mythtv_upcoming.head4 mythtv_upcoming.tail edit.fix.mythpages makefile /bin/cat mythtv_upcoming.head1 > mythtv_upcoming.html # /bin/ls -lT mythtv_upcoming | /usr/bin/awk '{printf ("Updated: %s %s %s, %s
\n", substr ($$8, 1, 5), $$6, $$7, $$9)}' >> mythtv_upcoming.html /bin/ls -l mythtv_upcoming | /bin/sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | /usr/bin/awk '{printf ("Updated: %s %s
\n", $$6, $$7)}' >> mythtv_upcoming.html /bin/cat mythtv_upcoming.head2 >> mythtv_upcoming.html $(HOME)/commands/meta-html < mythtv_upcoming | /usr/bin/awk -F' ' '{ printf ("%s%s%s%s%s\n", $$1, $$2, $$3, $$4, $$5)}' >> mythtv_upcoming.html echo "" >> mythtv_upcoming.html /bin/cat mythtv_status >> mythtv_upcoming.html /bin/cat mythtv_upcoming.head3 >> mythtv_upcoming.html $(HOME)/commands/meta-html < mythtv_upcoming | /usr/bin/sort -f -t' ' -k 3.13,3.16 -k 3.5,3.7M -k 3.9,3.10n -k 3.18,3.22 | /usr/bin/awk -F' ' '{ date = substr ($$3, 1, 10) ; if ((NR > 1) && ( date != prev )) { printf ("%d show", count) ; if (count > 1) {printf ("s")} ; printf (",") ; if (time > 60) { printf (" %d hr", (time/60)) ; if (time > 120) printf ("s") ; time = time % 60 } ; if (time) { printf (" %d min", time)} ; printf ("") ; if (space > 1000000) { printf ("%1.2f TB", (space/1000000))} else {if (space > 1000) { printf ("%1.1f GB", (space/1000))} else { printf ("%d MB", space)}} ; printf ("\n") ; count = 0 ; time = 0 ; space = 0 ; }} ; $$4 ~ /^[0-9]+ mins?$$/ { split ($$4, info, " ") ; mins = info[1] } ; $$4 ~ /^[0-9]+ hrs?$$/ { split ($$4, info, " ") ; mins = (60 * info[1]) } ; $$4 ~ /^[0-9]+ hrs? [0-9]+ mins?$$/ { split ($$4, info, " ") ; mins = (60 * info[1] + info[3]) } ; $$5 ~ /^SD / { bytes = (mins * 2200) / 60 } ; $$5 ~ /^HD / { bytes = (mins * 1150) / 60 } ; $$2 ~ /HD$$/ { bytes = (mins * 6000) / 60 } ; { count += 1 ; time += mins ; space += bytes ; prev = date ; if (bytes > 1000000) { size = sprintf ("%1.2f TB", (bytes/1000000))} else {if (bytes > 1000) { size = sprintf ("%1.1f GB", (bytes/1000))} else { size = sprintf ("%d MB", bytes)}} ; printf ("%s%s%s%s%s%s\n", $$1, $$2, $$3, $$4, size, $$5)} ; END { printf ("%d show", count) ; if (count > 1) {printf ("s")} ; printf (",") ; if (time > 60) { printf (" %d hr", (time/60)) ; if (time > 120) printf ("s") ; time = time % 60 } ; if (time) { printf (" %d min", time)} ; printf ("") ; if (space > 1000000) { printf ("%1.2f TB", (space/1000000))} else {if (space > 1000) { printf ("%1.1f GB", (space/1000))} else { printf ("%d MB", space)}} ; printf ("\n") }' >> mythtv_upcoming.html echo "" >> mythtv_upcoming.html /bin/cat mythtv_upcoming.head4 >> mythtv_upcoming.html $(HOME)/commands/meta-html < mythtv_upcoming_hd | /usr/bin/sort -f -t' ' -k 3.13,3.16 -k 3.5,3.7M -k 3.9,3.10n -k 3.18,3.22 | /usr/bin/awk -F' ' '{ date = substr ($$3, 1, 10) ; if ((NR > 1) && ( date != prev )) { printf ("%d show", count) ; if (count > 1) {printf ("s")} ; printf (",") ; if (time > 60) { printf (" %d hr", (time/60)) ; if (time > 120) printf ("s") ; time = time % 60 } ; if (time) { printf (" %d min", time)} ; printf ("") ; if (space > 1000000) { printf ("%1.2f TB", (space/1000000))} else {if (space > 1000) { printf ("%1.1f GB", (space/1000))} else { printf ("%d MB", space)}} ; printf ("\n") ; count = 0 ; time = 0 ; space = 0 ; }} ; $$4 ~ /^[0-9]+ mins?$$/ { split ($$4, info, " ") ; mins = info[1] } ; $$4 ~ /^[0-9]+ hrs?$$/ { split ($$4, info, " ") ; mins = (60 * info[1]) } ; $$4 ~ /^[0-9]+ hrs? [0-9]+ mins?$$/ { split ($$4, info, " ") ; mins = (60 * info[1] + info[3]) } ; $$5 ~ /^SD / { bytes = (mins * 2200) / 60 } ; $$5 ~ /^HD / { bytes = (mins * 1150) / 60 } ; $$2 ~ /HD$$/ { bytes = (mins * 6000) / 60 } ; { count += 1 ; time += mins ; space += bytes ; prev = date ; if (bytes > 1000000) { size = sprintf ("%1.2f TB", (bytes/1000000))} else {if (bytes > 1000) { size = sprintf ("%1.1f GB", (bytes/1000))} else { size = sprintf ("%d MB", bytes)}} ; printf ("%s%s%s%s%s%s\n", $$1, $$2, $$3, $$4, size, $$5)} ; END { printf ("%d show", count) ; if (count > 1) {printf ("s")} ; printf (",") ; if (time > 60) { printf (" %d hr", (time/60)) ; if (time > 120) printf ("s") ; time = time % 60 } ; if (time) { printf (" %d min", time)} ; printf ("") ; if (space > 1000000) { printf ("%1.2f TB", (space/1000000))} else {if (space > 1000) { printf ("%1.1f GB", (space/1000))} else { printf ("%d MB", space)}} ; printf ("\n") }' >> mythtv_upcoming.html echo "" >> mythtv_upcoming.html /bin/sed 's/PAGE_TIMESTAMP/'"`/bin/date`"'/' mythtv_upcoming.tail >> mythtv_upcoming.html /bin/ed mythtv_upcoming.html < edit.fix.mythpages # get the timestamp from the mythtv_contents data-extract file; use it after mythtv_contents.head1. # the bgcolor constants are also found in mythtv_contents.head2, mythtv_contents.head3, and mythtv_contents.head4, and should match those used here. # use the total time/space info placed on the side during the mythtv_contents data capture. # use awk to reformat the captured data into HTML table rows, with background colors set by watched/autoexpire attributes. # if mythtv_deleted is not an empty file: # do it again for deleted programs. # do it again for yesterday's and today's data, sorted by time. # add info from the MythWeb Status page. mythtv_contents.html: mythtv_contents mythtv_pilots mythtv_deleted mythtv_livetv mythtv_status mythtv_contents.head1 mythtv_contents.head2 mythtv_contents.head3 mythtv_contents.head4 mythtv_contents.head5 mythtv_contents.tail edit.fix.mythpages makefile /bin/cat mythtv_contents.head1 > mythtv_contents.html # /bin/ls -lT mythtv_contents | /usr/bin/awk '{printf ("Updated: %s %s %s, %s
\n", substr ($$8, 1, 5), $$6, $$7, $$9)}' >> mythtv_contents.html /bin/ls -l mythtv_contents | /bin/sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | /usr/bin/awk '{printf ("Updated: %s %s
\n", $$6, $$7)}' >> mythtv_contents.html /bin/sed -e 's/ out of .*/
/' mythtv_totals.`/bin/date '+%Y%m%d'` >> mythtv_contents.html /bin/cat mythtv_contents.head2 >> mythtv_contents.html $(HOME)/commands/meta-html < mythtv_contents | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_contents.html echo "" >> mythtv_contents.html # # include pilot episodes # if /usr/bin/test -s mythtv_pilots ; then /bin/cat mythtv_contents.head3 >> mythtv_contents.html ; $(HOME)/commands/meta-html < mythtv_pilots | /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,15n -k 5.17,5.21 | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_contents.html ; fi echo "" >> mythtv_contents.html # # include deleted episodes # if /usr/bin/test -s mythtv_deleted ; then /bin/cat mythtv_contents.head4 >> mythtv_contents.html ; $(HOME)/commands/meta-html < mythtv_deleted | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_contents.html ; fi # # show recent recordings (past 2 days; go back a 3rd day before 19:00) # /bin/cat mythtv_contents.head5 >> mythtv_contents.html if /usr/bin/test `/bin/date '+%k'` -lt 19 ; then /bin/grep "`$(HOME)/bin/date_name3 -3 | /bin/sed -e 's/-/ /g' -e 's/ 0/ /' -e 's/\([A-Z][a-z][a-z]\)[a-z]*/\1/'`" mythtv_contents | /usr/bin/sort -f -t' ' -k5 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { if (NR) { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }}' >> mythtv_contents.html ; fi /bin/grep "`$(HOME)/bin/date_name3 -2 | /bin/sed -e 's/-/ /g' -e 's/ 0/ /' -e 's/\([A-Z][a-z][a-z]\)[a-z]*/\1/'`" mythtv_contents | /usr/bin/sort -f -t' ' -k5 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { if (NR) { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }}' >> mythtv_contents.html ; fi /bin/grep "`$(HOME)/bin/date_name3 -1 | /bin/sed -e 's/-/ /g' -e 's/ 0/ /' -e 's/\([A-Z][a-z][a-z]\)[a-z]*/\1/'`" mythtv_contents | /usr/bin/sort -f -t' ' -k5 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { if (NR) { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }}' >> mythtv_contents.html /bin/grep "`$(HOME)/bin/date_name3 | /bin/sed -e 's/-/ /g' -e 's/ 0/ /' -e 's/\([A-Z][a-z][a-z]\)[a-z]*/\1/'`" mythtv_contents | /usr/bin/sort -f -t' ' -k5 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { if (NR) { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }}' >> mythtv_contents.html echo "" >> mythtv_contents.html /bin/cat mythtv_status >> mythtv_contents.html /bin/sed 's/PAGE_TIMESTAMP/'"`/bin/date`"'/' mythtv_contents.tail >> mythtv_contents.html /bin/ed mythtv_contents.html < edit.fix.mythpages # get the timestamp from the mythtv_contents data-extract file; use it after mythtv_expire.head1. # the bgcolor constants are also found in mythtv_contents.head* and mythtv_expire.head*, and should match those used here. # if mythtv_deleted is not an empty file: use awk to reformat the captured data into HTML table rows, w/ background colors set by watched/autoexpire attributes. # do it again with mythtv_livetv # do it again for non-deleted programs with auto-expire set. # do it again for non-deleted programs with auto-expire NOT set (i.e. show's we're keeping (for now)). mythtv_expire.html: mythtv_contents mythtv_deleted mythtv_livetv mythtv_expire.head1 mythtv_expire.head2 mythtv_expire.head3 mythtv_expire.head4 mythtv_expire.head5 mythtv_expire.head6 mythtv_expire.tail edit.fix.mythpages makefile /bin/cat mythtv_expire.head1 > mythtv_expire.html # /bin/ls -lT mythtv_contents | /usr/bin/awk '{printf ("Updated: %s %s %s, %s
\n", substr ($$8, 1, 5), $$6, $$7, $$9)}' >> mythtv_expire.html /bin/ls -l mythtv_contents | /bin/sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | /usr/bin/awk '{printf ("Updated: %s %s
\n", $$6, $$7)}' >> mythtv_expire.html if /usr/bin/test -s mythtv_deleted ; then /bin/cat mythtv_expire.head2 >> mythtv_expire.html ; /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,5.15n -k 5.17,5.21 mythtv_deleted | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_expire.html ; fi if /usr/bin/test -s mythtv_livetv ; then /bin/cat mythtv_expire.head3 >> mythtv_expire.html ; /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,5.15n -k 5.17,5.21 mythtv_livetv | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_expire.html ; fi /bin/cat mythtv_expire.head4 >> mythtv_expire.html /bin/grep 'AuToExP WaTcHeD' mythtv_contents | /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,5.15n -k 5.17,5.21 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_expire.html # echo "" >> mythtv_expire.html /bin/cat mythtv_expire.head5 >> mythtv_expire.html /bin/grep AuToExP mythtv_contents | /bin/grep -v WaTcHeD | /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,5.15n -k 5.17,5.21 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_expire.html # echo "" >> mythtv_expire.html /bin/cat mythtv_expire.head6 >> mythtv_expire.html /bin/grep -v AuToExP mythtv_contents | /usr/bin/sort -f -t' ' -k 5.5,5.8 -k 5.10,5.12M -k 5.14,5.15n -k 5.17,5.21 | $(HOME)/commands/meta-html | /usr/bin/awk -F' ' '{ time = 0 ; space = 0 ; line_color = "#ffffff" } ; /AuToExP/ { line_color = "#ffccff" } ; /WaTcHeD/ { line_color = "#ccffff" } ; /AuToExP WaTcHeD/ { line_color = "#ffe4c4" } ; $$6 ~ /^[0-9]+ min$$/ { split ($$6, info, " ") ; time = info[1] } ; $$6 ~ /^[0-9]+ hrs?$$/ { split ($$6, info, " ") ; time = (60 * info[1]) } ; $$6 ~ /^[0-9]+ hrs? [0-9]+ min$$/ { split ($$6, info, " ") ; time = (60 * info[1] + info[3]) } ; { tot_time += time } ; $$7 ~ /^[0-9\.]+ MB/ { split ($$7, info, " ") ; space = info[1] } ; $$7 ~ /^[0-9\.]+ GB/ { split ($$7, info, " ") ; space = (1000 * info[1]) } ; { tot_space += space } ; { rate = space / time } ; { rate_color = line_color } ; rate < 12 { rate_color = "peru" } ; rate > 34 { rate_color = "#eeeeee" } ; rate > 37 { rate_color = "#ffffaa" } ; $$2 == "-" { printf ("%s%s%s%s%s\n", line_color, $$1, $$4, $$5, $$6, rate_color, $$7) ; next } ; { printf ("%s: %s%s%s%s%s\n", line_color, $$1, $$2, $$4, $$5, $$6, rate_color, $$7)} ; END { printf ("%d show", NR) ; if (NR > 1) {printf ("s")} ; printf (" Total:") ; if (tot_time > 1440) { printf (" %d day", (tot_time/1440)) ; if (tot_time > 2880) printf ("s") ; tot_time = tot_time % 1440 } ; if (tot_time > 60) { printf (" %d hr", (tot_time/60)) ; if (tot_time > 120) printf ("s") ; tot_time = tot_time % 60 } ; if (tot_time) { printf (" %d min", tot_time)} ; printf ("") ; if (tot_space > 1000000) { printf ("%1.2f TB", (tot_space/1000000))} else {if (tot_space > 1000) { printf ("%1.1f GB", (tot_space/1000))} else { printf ("%d MB", tot_space)}} ; printf ("\n") }' >> mythtv_expire.html # echo "" >> mythtv_expire.html /bin/sed 's/PAGE_TIMESTAMP/'"`/bin/date`"'/' mythtv_expire.tail >> mythtv_expire.html /bin/ed mythtv_expire.html < edit.fix.mythpages mythtv_cbs_sun.html: mythtv_cbs_sun.head mythtv_cbs_sun.tail mythtv_expire.html /bin/sed 's/PAGE_DATE/'"`/bin/ls -l mythtv_expire.html | /usr/bin/cut -d' ' -f6-8`"'/' mythtv_cbs_sun.head > mythtv_cbs_sun.html /bin/egrep -w 'CBS |WUSA' mythtv_expire.html | /bin/egrep -w Sun >> mythtv_cbs_sun.html /bin/sed 's/PAGE_TIMESTAMP/'"`/bin/date`"'/' mythtv_cbs_sun.tail >> mythtv_cbs_sun.html replaytv_contents.html: $(HOME)/personal/tv/rtv replaytv_contents.head replaytv_contents.tail # makefile # /bin/sed -e 's/FILE_TIMESTAMP/'`/bin/ls -lT $(HOME)/personal/tv/rtv | /usr/bin/awk '{printf ("%s_%s_%s,_%s", $$8, $$6, $$7, $$9)}'`'/' -e 's/TOTAL_RECORDED/'`/usr/bin/awk '/^Channel/,/-------------------/' $(HOME)/personal/tv/rtv | /bin/fgrep ':' | /bin/egrep -v 'gone$$' | $(HOME)/awk/awk.zap.rtv.tot`'/' replaytv_contents.head | /bin/sed 's/:[0-5][0-9]_/ /' | /usr/bin/tr '_' ' ' > replaytv_contents.html # TIMESTAMP = $( shell /bin/ls -l $(HOME)/personal/tv/rtv | /bin/sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | /usr/bin/awk '{printf ("%s %s", $$6, $$7)}' ) # TIMETOTAL = $( shell /usr/bin/awk '/^Channel/,/-------------------/' $(HOME)/personal/tv/rtv | /bin/fgrep ':' | /bin/egrep -v 'gone$$' | $(HOME)/awk/awk.zap.rtv.tot ) # /bin/sed -e 's=FILE_TIMESTAMP='$(TIMESTAMP)'=' -e 's/TOTAL_RECORDED/'$(TIMETOTAL)'/' replaytv_contents.head | /usr/bin/tr '_' ' ' > replaytv_contents.html /bin/sed -e 's=FILE_TIMESTAMP='"`/bin/ls -l $(HOME)/personal/tv/rtv | /bin/sed -e 's=-01-=/Jan/=' -e 's=-02-=/Feb/=' -e 's=-03-=/Mar/=' -e 's=-04-=/Apr/=' -e 's=-05-=/May/=' -e 's=-06-=/Jun/=' -e 's=-07-=/Jul/=' -e 's=-08-=/Aug/=' -e 's=-09-=/Sep/=' -e 's=-10-=/Oct/=' -e 's=-11-=/Nov/=' -e 's=-12-=/Dec/=' | /usr/bin/awk '{printf ("%s %s", $$6, $$7)}'`"'=' -e 's/TOTAL_RECORDED/'`/usr/bin/awk '/^Channel/,/-------------------/' $(HOME)/personal/tv/rtv | /bin/fgrep ':' | /bin/egrep -v 'gone$$' | $(HOME)/awk/awk.zap.rtv.tot`'/' replaytv_contents.head | /usr/bin/tr '_' ' ' > replaytv_contents.html /usr/bin/awk '/^Channel/,/-------------------/' $(HOME)/personal/tv/rtv | /bin/fgrep ':' | /bin/egrep -v 'gone$$' | /bin/sed -e 's/ */ /g' -e 's/\[seen it\] /seen it, /' -e 's/\[seen it\]/seen it/' -e 's/FAM /Family /' -e 's/SPK /Spike /' -e 's/HIST /History /' -e 's/AETV /A\&E /' -e 's/BRAV /Bravo /' -e 's/TVL /TVLand /' -e 's/DISN /Disney /' -e 's/APL /Animal /' -e 's/DSC /Discovery /' -e 's/DHC /Health /' -e 's/LIFE /Lifetime /' -e 's/SYFY /Sci-Fi /' -e 's/TV1 /TV1\  /' -e 's/FOOD /Food /' -e 's/TVL /TVLand /' -e 's/COM /Comedy /' -e 's/TRAV /Travel /' -e 's/HALL /Hallmark /' -e 's/\û/\°/g' -e 's/[Ee]2/e\²/g' -e 's=NOT \(.*\) ->=\1=' -e '/ '`$(HOME)/bin/date_name4 . +2`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . +1`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -0`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -1`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -2`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -3`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -4`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -5`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -6`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -7`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e '/ '`$(HOME)/bin/date_name4 . -8`' /s_\(^[^ ]* \)\([^ ]* \)\([^ ]* \)\([^ ]*\)_\1\2\3\4_' -e 's=^=\ =' -e 's= =\ \ =g' -e 's///' -e 's///' -e 's=$$=\ =' -e 's/Marple, Series/Marple,\ 
\ Series/' >> replaytv_contents.html # /bin/echo -n 'TOTAL TIME' >> replaytv_contents.html # /usr/bin/awk '/^Channel/,/-------------------/' $(HOME)/personal/tv/rtv | /bin/fgrep ':' | $(HOME)/awk/awk.zap.rtv.tot >> replaytv_contents.html # /bin/echo '' >> replaytv_contents.html /bin/sed 's/PAGE_TIMESTAMP/'"`/bin/date`"'/' replaytv_contents.tail >> replaytv_contents.html reload: /bin/rm .newdirs .newfiles .oldfiles .subdirs $(HOME)/commands/upload.web # .oldfiles is meant to track what's been uploaded (at some point) to the web server. # This command retrieves the actual contents of the webserver. # Possibly, size-zero files should be filtered out so they're uploaded again? #.oldfiles: # echo "dir -R" | /usr/bin/ftp upload.comcast.net | $(HOME)/awk/awk.ls-lR.path /usr/bin/cut -d " " -f9- > .oldfiles # ignore edit.epi.nos entries for zap.tv EPisode numbers # using ctl-A as the pattern delimiter in the edit.rtv_epi_seq file; can't use "/" because it occurs in a program title rtv_episodes: ~/personal/tv/edit.epi.nos edit.rtv_episodes # edit.rtv_epi_seq mawk -F' ' '/^q$$/ {exit} ; /^g_[^^]/ { next } ; /_s__/ { if (NF == 5) { printf ("%s\t%s\n", substr ($$3, 5), $$4) } else { printf ("%s\t%s\n", substr ($$2, 5), $$3) }} ; /_s_ / { printf ("%s\t%s\n", substr ($$1, 4), $$6) ; next }' < ~/personal/tv/edit.epi.nos | tr -d '\\' | uniq > rtv_episodes ed rtv_episodes < edit.rtv_episodes # cut -f1 -d' ' < rtv_episodes | sort -f | uniq > rtv_programs cut -f1 rtv_episodes | sed -e 's/.*/& &/' -e 's/^[Aa] //' -e 's/^[Aa][Nn] //' -e 's/^[Tt][Hh][Ee] //' | sort -f | cut -f2 | uniq > rtv_programs sed -e 's=^=g^=' -e 's=$$= .m\$$=' rtv_programs > edit.rtv_epi_seq echo "w" >> edit.rtv_epi_seq echo "q" >> edit.rtv_epi_seq ed rtv_episodes < edit.rtv_epi_seq # sed 's/ \([0-9]\)\.\([0-9][-0-9]*\) / \1 \2 /' < rtv_episodes | sort -t' ' -k1 -k2 -k3 rtv_programs: rtv_episodes # cut -f1 -d' ' < rtv_episodes | sort -f | uniq > rtv_programs cut -f1 rtv_episodes | sed -e 's/.*/& &/' -e 's/^[Aa] //' -e 's/^[Aa][Nn] //' -e 's/^[Tt][Hh][Ee] //' | sort -f | cut -f2 | uniq > rtv_programs edit.rtv_epi_seq: rtv_programs sed -e 's=^=g/^=' -e 's=$$= /.m\$$=' rtv_programs > edit.rtv_epi_seq echo "w" >> edit.rtv_epi_seq echo "q" >> edit.rtv_epi_seq edit.rtv: ~/personal/tv/edit.epi.nos cat ~/personal/tv/edit.epi.nos | ~/personal/tv/sed.edit.rtv > edit.rtv edit.mythtv_upcoming: ~/personal/tv/edit.epi.nos sed.edit.mythtv_upcoming cat ~/personal/tv/edit.epi.nos | ./sed.edit.mythtv_upcoming > edit.mythtv_upcoming tv_episodes.html: rtv_episodes rtv_programs tv_episodes.head tv_episodes.tail edit.rtv.html cat tv_episodes.head > tv_episodes.html cat rtv_programs | $(HOME)/commands/meta-html | /bin/sed -e 's/E2/e\²/g' -e 's/e2/e\²/g' | awk '{printf ("
%s\n", $$0, $$0)}' | sed -e 's=^==' -e 's=$$==' | awk -f ~/awk/awk.4col | awk '{printf ("\n%s\n\n", $$0)}' >> tv_episodes.html echo "
" >> tv_episodes.html cat rtv_episodes | $(HOME)/commands/meta-html | /bin/sed -e 's/E2/e\²/g' -e 's/e2/e\²/g' | ./awk.tv_episodes >> tv_episodes.html cat tv_episodes.tail >> tv_episodes.html ed tv_episodes.html < edit.rtv.html #=# workspam.html: ~/projects/spam/portal.spamcounts #=# # sed -e 's/mtk-mail1/server2/g' -e 's/mtk-news1/server1/g' -e 's/mtk-news1/server1/g' -e 's/Mitretek Systems/Brent Chivers/g' -e 's/MTS //g' -e 's/mitretek.org and bristolgroup.com //g' -e 's/bristolgroup/acquisition1/g' -e 's/bgconsulting/acquisition2/g' -e 's/jrk/acquisition3/g' -e 's/new .* domains/new acquisitions domains/' -e "s/acquisitions/acquisitions'/" -e '/sendmail.access/d' < ~/projects/spam/portal.spamcounts > workspam.html #=# sed -e 's/mtk-mail1/server2/g' -e 's/mtk-news1/server1/g' -e 's/Noblis/Company/g' -e 's/Mitretek Systems/Company/g' -e 's/MTS/Company/g' -e 's/noblis/main_company/g' -e 's/mitretek/main_company/g' -e 's/bristolgroup/acquisition1/g' -e 's/bgconsulting/acquisition2/g' -e 's/jrk/acquisition3/g' -e 's/new .* domains/new acquisitions domains/' -e "s/acquisitions/acquisitions'/" -e '/sendmail.access/d' < ~/projects/spam/portal.spamcounts > workspam.html #=# /bin/cp -p $(HOME)/projects/spam/spam.png spam.png #=# #=# spam.png: ~/projects/spam/spam.png #=# /bin/cp $(HOME)/projects/spam/spam.png spam.png #=# # need a new timestamp on spam.png to get added to .newfiles list. 8-( #=# # /bin/cp -p $(HOME)/projects/spam/spam.png spam.png #=# # don't know why I can't say "~/projects/spam/spam.png" for the cp.... check: ./webcheck.env -f -o ../vrfy/bdchivers http://bdchivers.home.comcast.net/ test: ./webcheck.env -f -o ../vrfy/bdchivers http://bdchivers.home.comcast.net/ tv.html: tv $(HOME)/commands/mk.tv.html $(HOME)/commands/mk.tv.html > tv.html vrfy: ./webcheck.env -f -o ../vrfy/bdchivers http://bdchivers.home.comcast.net/ webcheck: ./webcheck.env -f -o ../vrfy/bdchivers http://bdchivers.home.comcast.net/~bdchivers/ #lvrfy: # /bin/rm lvrfy.ok lvrfy.bad lvryf.off # ./lvrfy / home lvrfy.ok lvrfy.bad lvryf.off #lintdisk: # linklint -doc ../linklint /@ # linklint -doc ../linklint @linklint #lintweb: # linklint -doc ../linklint -http -host bdchivers.home.comcast.net /@ #lintremote: # linklint -doc ../linklint http://bdchivers.home.comcast.net /@