mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Ported banterbot to pinhook framework and some other changes
This commit is contained in:
1 parent
0627b4a9e3
commit
bc102890b2
39 files changed
+1629
-507
No files matched your search
@@ -1,15 +1,23 @@
|
||||
#!/bin/bash
|
||||
START=$((`date +%s` - 2678400))
|
||||
START=$((`date +%s` - 2678400)) # 31 days
|
||||
END=`date +%s`
|
||||
MONTH=`date -d yesterday +_%Y_%m`
|
||||
DATE=`date -d yesterday +%b\ %Y`
|
||||
OUT=/home/krowbar/logs/chatcloud${MONTH}.json
|
||||
DIR=/home/krowbar/public_html/data
|
||||
PAGE=/home/krowbar/public_html/chatcloud/index.html
|
||||
LINE=16
|
||||
LINE=16 # This is the magic line number where we want to insert the new option in the dropdown
|
||||
|
||||
/usr/bin/python /home/krowbar/Code/python/chatcloud2.py -timeend $END -timestart $START -outfile $OUT
|
||||
ln -s $OUT $DIR
|
||||
/usr/bin/python /home/krowbar/Code/python/chatcloud2.py -timeend $END -timestart $START -outfile $OUT -timestamp "month"
|
||||
if [ ! -e ${DIR}/chatcloud${MONTH}.json ]
|
||||
then
|
||||
ln -s $OUT $DIR
|
||||
echo Creating link to $OUT in $DIR
|
||||
else
|
||||
echo Skipping linking... already exists in $DIR
|
||||
fi
|
||||
|
||||
sed "${LINE}i <option value=\"${MONTH}\">${DATE}</option>" < $PAGE > $PAGE.tmp
|
||||
echo Added option for ${DATE} in $PAGE
|
||||
|
||||
mv $PAGE.tmp $PAGE
|
||||
Reference in new issue
Block a user