diff --git a/shell_scripts/browser_queries b/shell_scripts/browser_queries index 936f674..92a0ea1 100755 --- a/shell_scripts/browser_queries +++ b/shell_scripts/browser_queries @@ -17,6 +17,7 @@ # Note that the name might be misleading since currently only Firefox SQLite format is supported ANHOURAGO=`date +%s --date "now 1 hour ago"` +ADAYAGO=`date +%s --date "now 1 day ago"` AWEEKAGO=`date +%s --date "now 1 week ago"` DB=~/.mozilla/firefox/*.default/places.sqlite @@ -27,7 +28,8 @@ echo -e "\ntop 10 visited URL in general" echo "this week" #sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($AWEEKAGO*1000000)" echo "this hour" -sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($ANHOURAGO*1000000)" +#sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($ANHOURAGO*1000000)" +#sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($ADAYAGO*1000000)" URL=$1 echo -e "\nhow many time URL X has been visited this week" @@ -44,12 +46,12 @@ echo -e "\nURLs visited between starting URL and ending URL" URLSLISTFILE=~/.urlstocheck -SCRIPTURL=`grep '^\$ScriptUrl' ~/www/mirrors/fabien/local/config.php | grep -v 127 | sed -e "s/.*'\(.*\)';/\1/"` -echo "" > $URLSLISTFILE -ls ~/www/mirrors/fabien/wiki.d/ | grep -v "del-" | tr "." "/" | sed -e "s,^,$SCRIPTURL\/," >> $URLSLISTFILE -while read line; do - sqlite3 -column $DB "SELECT count(*),url FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and url LIKE '$line'" | grep "0" && echo -e "\t$line" -done < $URLSLISTFILE +#SCRIPTURL=`grep '^\$ScriptUrl' ~/www/mirrors/fabien/local/config.php | grep -v 127 | sed -e "s/.*'\(.*\)';/\1/"` +#echo "" > $URLSLISTFILE +#ls ~/www/mirrors/fabien/wiki.d/ | grep -v "del-" | tr "." "/" | sed -e "s,^,$SCRIPTURL\/," >> $URLSLISTFILE +#while read line; do +# sqlite3 -column $DB "SELECT count(*),url FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and url LIKE '$line'" | grep "0" && echo -e "\t$line" +#done < $URLSLISTFILE echo -e "\nwhich URLs from this list have never been visited this week" echo -e "\nwhich URLs from this list have never been visited in general" # e.g. all wiki pages, all page from a wiki group (e.g. memory recall) diff --git a/shell_scripts/logs_anchors_generation b/shell_scripts/logs_anchors_generation new file mode 100755 index 0000000..13a44bc --- /dev/null +++ b/shell_scripts/logs_anchors_generation @@ -0,0 +1,10 @@ +#! /usr/bin/env bash + +# TODO +# escape HTML characters +# slice by month as very long logs are problematic +# generalize for non supybot log + +LOG_SOURCE=/home/utopiah/web/thelab/stigmergylive/logs/ChannelLogger/freenode/##pim/##pim.log +HTML_DEST=/home/utopiah/web/thelab/stigmergylive/logs/ChannelLogger/freenode/##pim/anchoredlog.html +echo "" > $HTML_DEST && cat $LOG_SOURCE | sed "s//]/" | sed "s/\(.*\) \([*[].*\)/<\/a>\1<\/a> \2/" | sed "s/^/

/" | sed "s/$/<\/p>/" >> $HTML_DEST && echo "" >> $HTML_DEST diff --git a/shell_scripts/logs_links_extraction b/shell_scripts/logs_links_extraction new file mode 100755 index 0000000..c12643c --- /dev/null +++ b/shell_scripts/logs_links_extraction @@ -0,0 +1,6 @@ +#! /usr/bin/env bash + +SOURCE_LOG=/home/utopiah/web/thelab/stigmergylive/logs/ChannelLogger/freenode/##pim/##pim.log +DEST_HTML=/home/utopiah/web/pim/links_fresh.html + +echo "" > $DEST_HTML && cat $SOURCE_LOG | grep http: | sed -e "s/.*\(http\S*\).*/\1<\/a>
/" | grep -v seedea.org > $DEST_HTML && echo "" >> $DEST_HTML