#!/bin/sh TEMP=temp.$$.html # Change this which posting first blog each year THISYEAR=2021 # Year of last entry in index.html ALLYEAR=2020 awkscript () { TOP=$1 if [ -z "$TOP" ] ; then TOP="top" fi BOTTOM=$2 if [ -z "$BOTTOM" ] ; then BOTTOM="bottom" fi if [ "$PLAIN" != "YES" ] ; then cat $TOP fi cat $BINDEX | egrep '^'$IYEAR | awk -F\| ' BEGIN { even = 0 plain="'$PLAIN'" longsum="'$LONGSUM'" THISYEAR="'$THISYEAR'" IYEAR="'$IYEAR'" m["01"]="January" m["02"]="February" m["03"]="March" m["04"]="April" m["05"]="May" m["06"]="June" m["07"]="July" m["08"]="August" m["09"]="September" m["10"]="October" m["11"]="November" m["12"]="December" if(plain !~ /YES/) { print "
" if(longsum !~ /YES/) { if(IYEAR < 2010) { print "All blog entries" } else { print "" IYEAR print "blog entries" } } else { #print "Recent blog entries" #print " " #print "Follow @samiamorg " print "
" print "" STITLE "" print "
" print "" STITLE "" print "
" TITLE "
" } } else { print "
" # print "
All '$ALLYEAR' entries" if(longsum ~ /YES/) { print "
Automated eBook blog conversions" print "
All entries" } }' if [ "$PLAIN" != "YES" ] ; then cat $BOTTOM fi } #################### E-BOOK CONVERSION: TIME CONSUMING! #################### #echo Updating ebook of blogs #./make.ebook.sh ############################################################################ BINDEX=blog.index rm -f foo foo1 cd embed/ for a in 20[12]*embed ; do echo $a ../summarize.pl $a >> ../foo ../long-summary.pl $a >> ../foo1 done cd .. sort -r foo | sed 's/embed/html/' > $BINDEX sort -r foo1 | head -17 | sed 's/embed/html/' > blog.index.long # RSS never officially had enough features for a real news feed, so # unofficial extensions we done and are inconsistent across RSS readers. # Sigh. ./make.rss > blog.rss #cp blog.rss blog_strict.rss #cp blog.rss feedburner.rss # For http://feeds.feedburner.com/samiamorg (no links or
in description)
./make.feedburner.rss > feedburner.rss
cp feedburner.rss blog_strict.rss
./make.maradns.rss > maradns.rss
#cp maradns.rss maradns_strict.rss
./make.maradns_strict.rss > maradns_strict.rss
#rm -f foo foo1
TAG='.'
#awkscript > $TEMP
for IYEAR in 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 ; do
awkscript top-2019 bottom-2019 > $IYEAR.html
done
IYEAR=20
awkscript top-2019 bottom-2019 > all.html
TAG='G'
awkscript top-2019 bottom-2019 > $TAG.html
TAG='L'
awkscript top-2019 bottom-2019 > $TAG.html
TAG='M'
awkscript top-2019 bottom-2019 > $TAG.html
TAG='N'
awkscript top-2019 bottom-2019 > $TAG.html
TAG='O'
awkscript top-2019 bottom-2019 > $TAG.html
TAG='P'
awkscript top-2019 bottom-2019 > $TAG.html
TAG=''
PLAIN='YES'
awkscript | head -47 > iframe.html
#awkscript | head -37 > iframe-$TEMP
#echo look at $TEMP and iframe-$TEMP
TAG='.'
PLAIN='NO'
LONGSUM='YES'
BINDEX=blog.index.long
awkscript > index-2012.html
awkscript top-2019 bottom-2019 > idx.html
cat $(ls 20*-*html | tail -1) | perl -pe '
s|||;
s|
" }' > old-posts.html
echo old-posts.html made